- 외장하드 되게 삑삑대네... ㅡㅡ 2022.08.23
- 페이지네이션 2022.08.23
- 백준 2108번 풀이 2022.08.23
- 백준 25305번 풀이 2022.08.23
- RE with FLASK-시퀀스 정보 2022.08.23
- R 배워보기-8.4. Other interesting graphs 2022.08.23
- R 배워보기-8.3. Basic graphs with standard graphics 2022.08.23
- R 배워보기-8.2. Miscellaneous 2022.08.23
- R 배워보기-번외편: R로 standard curve 그리기 2022.08.22
- R의 내장 데이터 (부제: 공공데이터 어떻게 받아요?) 2022.08.22
삑삑거린지는 좀 됐는데... 이게 유전원 허브에 연결한거라 전원이 모자랄 리도 없고...
연결이 툭하면 끊겨서 어제 안에 있던 파일 다 옮겼음..
거기 있는거 다 그림작업 하고 그런거라 날아가면 참사 터집니다.
파일 옮기는데도 무지하게 삑삑거리더만. 무슨 러버덕이야 뭐야.
'잡담 > 단문' 카테고리의 다른 글
알약 난리났네… (0) | 2022.08.30 |
---|---|
유튜브 광고가 너무 두서없음.. (0) | 2022.08.26 |
하느님 맙소사... (0) | 2022.08.25 |
그 바 이름이 뭐더라... (0) | 2022.08.24 |
(대충 새로 만들었다는 얘기) (0) | 2022.08.19 |
매우 고급져보이는 이 단어의 뜻은 정말 생각지도 못하게 심플하고, 여러분은 이미 이걸 몇 번 봤다.
이런거 다들 한번씩 봤잖음. 블로그건 검색이건... 이게 페이지네이션이다. 저게 코딩관련 글을 11페이지로 옮겼는데(다 옮겼음) 분량이 어마무시하다 그죠...? 아무튼, 페이지네이션은 이런 식으로 한 페이지에 정해진 양의 콘텐츠를 보여준다. 반대되는 개념인 무한 스크롤은 끝이 보일때까지 아래로 아래로 내리는 것.
무한 스크롤은 보통 모바일 앱에서 많이 사용하는 방식인데, 인별이나 미디움도 무한 스크롤이다. 아래로 스크롤하면서 콘텐츠를 계속 볼 수 있어서 굳이 페이지 이동하고 로딩하는 걸 기다리지 않아도 된다. 하지만 콘텐츠가 많아지면 로딩하는 데 시간이 걸리기도 하고(...), 읽다 보면 스크롤바는 줄어드는데 이게 대체 어디까지 있는건지 모르기도 하고, 페이지의 밑으로 내려가면 계속 콘텐츠가 로딩이 되는 특성상 사이트의 푸터가 안보이기 때문에 사이드바로 푸터를 빼야 한다.
페이지네이션은 페이지를 클릭하고 로딩해야 하는 수고로움+추가 작업의 수고로움이 있지만 한 페이지에 표시할 수 있는 최대 콘텐츠의 수가 정해져있다. 그래서 내가 아까 봤던 글이 몇페이지 어디 있더라, 만 알면 다시 가서 볼 수 있다. 그리고 아 이쪽 콘텐츠는 재미없다 그러면 그냥 다음 페이지로 가면 된다. 이렇게 둘 다 일장일단이 있기 때문에 적절한 사용이 중요하다고.
페이지네이션 구현하기
Reference
https://nohack.tistory.com/125
https://velog.io/@eunoia/JS%EB%A1%9C-Pagination-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0
초간단! 페이지네이션
해당 코드는 참고문헌 1번에 있으니 별도로 올리지는 않는다.
게시판이긴 한데, 테이블이 아니라 li태그 안에 display: flex를 줘서 구현했다. 저거... 아 저 내용물은 동적으로 생성한거라 저래요... DB에서 갖고온 게 아님... 아무튼 그렇다.
페이지네이션을 할 때 필요한 건
1) 한 페이지에 콘텐츠 몇 개를 보여줄 것인가?
2) 페이지를 넘기는 버튼은 한 페이지에 몇 개를 보여줄 것인가? (목록 밑에 숫자 써있는거)
이거다. 이 두 개를 정하고 나면 전체 콘텐츠 개수에 따라 필요한 페이지 수를 계산하고 버튼을 만들면 된다.
그리드 페이지네이션
위에 있는 컨텐츠는 게시판 리스트같이 생긴건데, 이번에 구현할 건 컨텐츠가 그리드 형태이다. 그니까 저렇게 길고 쭉 뻗은 리스트가 아니고 네모땡땡한 거다. 인스타 피드같은 거.
<html>
<head>
<meta charset="UTF-8" />
<title>Pagenation</title>
<link rel="stylesheet" href="style.css" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/dc58858c96.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<div class="card" id="article-title">
<div class="card-body">
<h4 class="card-title">est velit</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Quisque egestas diam in arcu cursus euismod. Eu feugiat
pretium nibh ipsum consequat nisl vel pretium. Tempus quam pellentesque nec nam. In fermentum
posuere urna nec tincidunt. Massa enim nec dui nunc mattis enim ut tellus elementum. Fringilla est
ullamcorper eget nulla facilisi etiam. At imperdiet dui accumsan sit amet nulla facilisi morbi. Vel
pretium lectus quam id leo. Ut faucibus pulvinar elementum integer enim neque. Gravida neque
convallis a cras semper auctor neque vitae. Lacus vestibulum sed arcu non odio euismod lacinia at
quis. Faucibus pulvinar elementum integer enim neque volutpat ac tincidunt. Porta nibh venenatis
cras sed felis.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="content-body">
</div>
<div class="buttons">
</div>
</div>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
</body>
</html>
물논 부트스트랩의 도움을 조금 받았지. (안에 있는 텍스트는 Lorem ipsum generator로 만들었음)
@font-face {
font-family: 'DungGeunMo';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/DungGeunMo.woff') format('woff');
font-weight: normal;
font-style: normal;
}
* {
margin: 0;
padding: 0;
font-family: 'DungGeunMo';
font-size: 14pt;
color: #234E70;
}
.wrapper {
width: 1280px;
margin: 0 auto;
}
#article-title {
margin: 15px auto;
background-color: #FBF8BE;
border: 1px solid #234E70;
}
#article-title .btn-primary {
background-color: #234E70;
color: #FBF8BE;
border: none;
}
.content-body {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3.1fr);
grid-gap:5px;
}
.col-sm-6 {
width: 100% !important;
}
#contents {
background-color: #234E70;
color: #FBF8BE;
}
#contents .card-title,
#contents .card-text {
color: #FBF8BE;
}
#contents .btn-primary {
background-color: #FBF8BE;
color: #234E70;
border: none;
}
.buttons {
text-align: center;
width: 100%;
margin:15px auto;
}
button {
border: none;
background-color: #fff;
color: #234E70;
width:50px;
}
.active {
background-color: #234E70;
color: #FBF8BE;
}
CSS의 경우 버튼 부분(페이지 아래에 있는 넘어가는 버튼)은 나중에 했다. 봐야 뭘 하지.
const contents = document.querySelector('.content-body')
const buttons = document.querySelector('.buttons')
const numOfContent = 100
const maxContent = 9
const maxButton = 5
const maxPage = Math.ceil(numOfContent / maxContent)
let page = 1
const makeContent = (id) => {
const content = document.createElement('div')
content.classList.add('col-sm-6')
content.setAttribute('id', 'contents-card')
content.innerHTML = `
<div class="card" id="contents">
<div class="card-body">
<h5 class="card-title">No. ${id}</h5>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</a>
</div>
</div>`
return content
}
const makeButton = (id) => {
const button = document.createElement('button')
button.classList.add('button')
button.dataset.num = id
button.innerText = id
button.addEventListener("click", (e) => {
Array.prototype.forEach.call(buttons.children, (button) => {
if (button.dataset.num) button.classList.remove("active")
})
e.target.classList.add("active")
renderContent(parseInt(e.target.dataset.num))
})
return button
}
const prevPage = () => {
page -= maxButton
render(page)
}
const nextPage = () => {
page += maxButton
render(page)
}
const prev = document.createElement('button')
prev.classList.add('button','prev')
prev.innerHTML = '<i class="fa-solid fa-angle-left"></i>'
prev.addEventListener('click', prevPage)
const next = document.createElement('button')
next.classList.add('button','next')
next.innerHTML = '<i class="fa-solid fa-angle-right"></i>'
next.addEventListener('click',nextPage)
const renderContent = (page) => {
while(contents.hasChildNodes()) {
contents.removeChild(contents.lastChild)
}
for (let id = (page - 1) * maxContent + 1;id <= page * maxContent && id <= numOfContent;id++){
contents.appendChild(makeContent(id))
}
}
const renderButton = (page) => {
while(buttons.hasChildNodes()) {
buttons.removeChild(buttons.lastChild)
}
for (let id = page;id < page + maxButton && id <= maxPage;id++) {
buttons.appendChild(makeButton(id))
}
buttons.children[0].classList.add('active')
buttons.prepend(prev)
buttons.append(next)
if (page - maxButton < 1) buttons.removeChild(prev)
if (page + maxButton > maxPage) buttons.removeChild(next)
}
const render = (page) => {
renderContent(page)
renderButton(page)
}
render(page)
JS에서 동적으로 생성했다고 했는데, 그리드뷰도 마찬가지다. render~에서 만드는거다.
그리드쪽 높이를 고정하지 않으면 저렇게 버튼이 올라간다. 그래도 페이지네이션 구현했지롱! 참고로 CSS에서 display를 그리드로 줬기 때문에 위치를 잘 계산한 다음 네모땡땡한 것이 grid에서 어느정도를 차지하는가를 지정할 수 있다. 그게 무슨 말이냐면, 어떤건 크고 어떤건 작고 이런 게 가능하다. (근데 내용이 짧으면 자동 채우기가 안된다는 단점이...)
테이블 페이지네이션
콘텐츠가 예전 게시판스타일대로 table 태그에 담겨져 있다. 그래서 동적으로 추가할 때 table 전체가 아니라 그 안에 있는 tr태그를 추가해야 한다. (table 안에 tr 안에 td)
<html>
<head>
<meta charset="UTF-8" />
<title>Pagenation</title>
<link rel="stylesheet" href="style.css" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/dc58858c96.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<h1>integer quis auctor elit</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Tellus molestie nunc non blandit. Adipiscing enim eu turpis egestas pretium aenean pharetra.
Sed lectus vestibulum mattis ullamcorper velit sed.</p>
<table class="table table-primary table-striped table-hover" id="table-body">
<thead>
<tr>
<th>ID</th>
<th>Title1</th>
<th>Title2</th>
</tr>
</thead>
<tbody class="table-body">
<tr class="table-row">
<td>1</td>
<td>integer</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.</td>
</tr>
</tbody>
</table>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
</ul>
</nav>
</div>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
</body>
</html>
테이블과 페이지 번호 그거는 부트스트랩꺼 가져왔는데, 이거 생각보다 힘든게 CSS가 안먹혀서 죄다 important 때렸다... 아무튼, 페이지 번호는 ul 안에 li태그 안에 a까지 있는 구조이고, table은 원래 thead tbody가 없었는데 th 추가하려고 넣었다. 우리가 동적으로 추가할 tr은 tbody에 들어간다.
@font-face {
font-family: 'CookieRunOTF-Bold';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/CookieRunOTF-Bold00.woff') format('woff');
font-weight: normal;
font-style: normal;
}
* {
margin:0;
padding:0;
font-family:'CookieRunOTF-Bold';
}
.wrapper {
width:1280px;
margin:0 auto;
}
table {
margin: 15px auto;
}
.page-link {
border:none!important;
}
.page-item.active {
border-bottom: 3px solid #0d6efd;
}
.page-item.active .page-link {
background-color:transparent!important;
color:#0d6efd!important;
}
위에도 말했듯... 걍 CSS 줬더니 안먹혀서 important 때렸음... 그거 말고는 딱히 특이한 건 없다.
const contents = document.querySelector('.table-body')
const buttons = document.querySelector('.pagination')
const numOfContent = 120
const maxContent = 10
const maxButton = 5
const maxPage = Math.ceil(numOfContent / maxContent)
let page = 1
const makeContent = (id) => {
const content = document.createElement('tr')
content.classList.add('.table-row')
content.innerHTML = `
<td>${id}</td>
<td>Title_Text ${id}</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.</td>`
return content
}
const makeButton = (id) => {
const button = document.createElement('li')
const link = document.createElement('a')
button.classList.add('page-item')
link.classList.add('page-link')
button.dataset.num = id
link.dataset.num = id
button.appendChild(link)
link.innerText = id
link.href = '#'
button.addEventListener("click", (e) => {
Array.prototype.forEach.call(buttons.children, (button) => {
if (link.dataset.num) button.classList.remove("active")
})
button.classList.add("active")
renderContent(parseInt(e.target.dataset.num))
})
return button
}
const prevPage = () => {
page -= maxButton
render(page)
}
const nextPage = () => {
page += maxButton
render(page)
}
const prev = document.createElement('li')
prev.classList.add('page-item','prev')
prev.innerHTML = '<a class="page-link" href="#">Previous</a>'
prev.addEventListener('click', prevPage)
const next = document.createElement('li')
next.classList.add('page-item','next')
next.innerHTML = '<a class="page-link" href="#">Next</a>'
next.addEventListener('click',nextPage)
const renderContent = (page) => {
while(contents.hasChildNodes()) {
contents.removeChild(contents.lastChild)
}
for (let id = (page - 1) * maxContent + 1;id <= page * maxContent && id <= numOfContent;id++){
contents.appendChild(makeContent(id))
}
}
const renderButton = (page) => {
while(buttons.hasChildNodes()) {
buttons.removeChild(buttons.lastChild)
}
for (let id = page;id < page + maxButton && id <= maxPage;id++) {
buttons.appendChild(makeButton(id))
}
buttons.children[0].classList.add('active')
buttons.prepend(prev)
buttons.append(next)
if (page - maxButton < 1) buttons.removeChild(prev)
if (page + maxButton > maxPage) buttons.removeChild(next)
}
const render = (page) => {
renderContent(page)
renderButton(page)
}
render(page)
버튼이 원래는 disabled 클래스가 따로 있었는데, 그거 그대로 따라가려고 했더니 그만... 페이지가 음수가 떠버린것이고... (주륵)
기본적인 거 말고 CSS 건드린 건 딱히 없다.
'Coding > JavaScript' 카테고리의 다른 글
나홀로 메모장 파생형 만들기-구성 및 사이드바 달력 (0) | 2022.08.29 |
---|---|
마우스를 따라다니는 무언가 만들기 (0) | 2022.08.24 |
원페이지 쇼핑몰 보강하기-익스트림 CRUD (0) | 2022.08.19 |
To-do list 바닐라JS로 만들기 (0) | 2022.08.19 |
원페이지 쇼핑몰 보강하기-익스트림 어드레스+익스트림 CRUD(준비) (0) | 2022.08.19 |
문제
https://www.acmicpc.net/problem/2108
산술평균, 최빈값, 중앙값, 범위 출력하기
Reference
https://jiwon-coding.tistory.com/8
풀이
아니 R이랑 엑셀 냅두고 왜... 걔네는 장식인가
여기서 얘기하는 산술평균이 우리가 일반적으로 얘기하는 평균이다. 평균은 산술/기하/조화평균이 있는데 이건 나중에 얘기하도록 하자... 아무튼, 그래서 4가지 요소를 어떻게 구하느냐... 평균은 일반적인 그 평균이 '맞다'. 중앙값은 말 그대로 정렬된 배열의 가운데에 있는 값이고, 최빈값은 배열에서 제일 많은 값(단, 여러개일 경우 두번째로 작은거), 범위는 최대-최소 하면 된다.
근데 여기서 최빈값이 끝판왕임.
import sys
from collections import Counter
N = int(sys.stdin.readline())
arr = []
for _ in range(N):
arr.append(int(sys.stdin.readline()))
average = round(sum(arr)/N)
print(average)
# Average
arr.sort()
median = arr[N // 2]
print(median)
# Median
count_array = Counter(arr).most_common()
if len(count_array) > 1 and count_array[0][1] == count_array[1][1]:
print(count_array[1][0])
else:
print(count_array[0][0])
range = max(arr) - min(arr)
print(range)
저 콜렉션 저거는 더 찾아보고 알려드림. 한가지 확실한건 저게 있어서 그나마 코드가 저렇게 짧은겁니다. ㄹㅇ임.
평균: 다 더해서 배열 길이로 나눈다
중앙값: 배열을 정렬한 다음 배열 길이 // 2의 값을 가져온다. (길이가 5면 2, 7이면 3 이런 식. 파이썬은 0부터 센다)
최빈값: 어레이를 하나 만들건데 배열 안에 들어있는 값과 몇개인지가 들어가게 된다. 이 배열을 비교해서 옆에 있는 애랑 개수가 같으면 두번째 놈을 출력한다.
범위: 최댓값-최솟값(개심플)
엥? 배열이 어떻게 나오길래 그래요?
[(-2, 2), (-1, 2), (-3, 1)]
이렇게 나온다. 오른쪽 값이 개수인데, 그게 같은 것끼리 정렬하고 큰 그림을 그리는 식이라 저걸로 처리된 것.
결론: 엑셀 쓰자 결론 에반데
'BOJ > [BOJ] Python' 카테고리의 다른 글
백준 25501번 풀이 (0) | 2022.09.13 |
---|---|
백준 1427번 풀이 (0) | 2022.08.23 |
백준 25305번 풀이 (0) | 2022.08.23 |
백준 10989번 풀이 (0) | 2022.08.20 |
백준 2750번 풀이 (0) | 2022.08.20 |
문제
https://www.acmicpc.net/problem/25305
참가자 인원 수와 상을 타는 인원 수, 그리고 점수가 주어졌을 때 점수가 가장 낮은 사람을 출력하시오
풀이
보통 커트라인이라고 하면 수능이나 모평때 많이 쓰는 말인데, 9월 모평 1등급 등급컷이 얼마더라~ 이런 식으로 쓴다. 수능이나 모평의 등급컷은 전체적인 난이도와 참여 인원에 따라 달라지기때문에 똑같이 50점을 받았어도 난이도가 핵불닭수능이면 등급이 높고, 물수능이면 등급 망한다.
아, 그거랑 별개로 이 문제는 대단히 쉽다. 입력받은 점수를 정렬하고 뒤에서 k번째인 원소를 뽑으면 되거든.
import sys
N, k = map(int,sys.stdin.readline().split())
x = list(map(int,sys.stdin.readline().split()))
def merge_sort(array):
if len(array) < 2:
return array
mid = len(array) // 2
low_arr = merge_sort(array[:mid])
high_arr = merge_sort(array[mid:])
# 일단 짼다
merged_arr = []
l = h = 0
while l < len(low_arr) and h < len(high_arr):
if low_arr[l] < high_arr[h]:
merged_arr.append(low_arr[l])
l += 1
else:
merged_arr.append(high_arr[h])
h += 1
merged_arr += low_arr[l:]
merged_arr += high_arr[h:]
return merged_arr
# 그리고 비교한다
print(merge_sort(x))
일단 잘못하면 응애 나 애기시간초과! 가 반길수도 있으니 빠름 빠름 빠름 LTE-빠름! 이라는 병합정렬을 가져와보자. 그리고 예시를 저기에 돌려보면
5 2
100 76 85 93 98
[76, 85, 93, 98, 100]
정답이 98인데... 뒤에서 두번째에 있다.
import sys
N, k = map(int,sys.stdin.readline().split())
x = list(map(int,sys.stdin.readline().split()))
def merge_sort(array):
if len(array) < 2:
return array
mid = len(array) // 2
low_arr = merge_sort(array[:mid])
high_arr = merge_sort(array[mid:])
# 일단 짼다
merged_arr = []
l = h = 0
while l < len(low_arr) and h < len(high_arr):
if low_arr[l] < high_arr[h]:
merged_arr.append(low_arr[l])
l += 1
else:
merged_arr.append(high_arr[h])
h += 1
merged_arr += low_arr[l:]
merged_arr += high_arr[h:]
return merged_arr
# 그리고 비교한다
print(merge_sort(x)[-k])
그래서 정렬하고 뒤에서 k번째인 수를 뽑으면 되기 때문에 -k로 인덱싱 해 주면 된다. (-1이 뒤에서 첫번째)
'BOJ > [BOJ] Python' 카테고리의 다른 글
백준 1427번 풀이 (0) | 2022.08.23 |
---|---|
백준 2108번 풀이 (0) | 2022.08.23 |
백준 10989번 풀이 (0) | 2022.08.20 |
백준 2750번 풀이 (0) | 2022.08.20 |
백준 1436번 풀이 (0) | 2022.08.20 |
FASTA, Genbank파일을 처리할때와 달리 ipynb일때부터 직접 입력하는 시퀀스 정보는 수기로 같이 받았다. 추가가 늦었을 뿐이지...
입력란 만들면서 제일 고생했던 건 CSS였음... 망할 그리드... ㅡㅡ 아무튼.
추가한 순서는
1. HTML
2. CSS(여기서 좀 고생함)
3. JS
4. app.py
JS나 Python파일은 크게 수정할 건 없고 Ajax로 주고받는 것만 추가하면 된다.
checked_finder.forEach(function (i) {
if (checked_finder[0].checked == true) {
textarea[2].disabled = false;
sequence_name.disabled = false;
sequence_desc.disabled = false
sequence_name.focus();
textarea[2].value = ''
} else if (checked_finder[1].checked == true) {
upload_fasta[1].disabled = false;
} else {
upload_gen[1].disabled = false;
}
})
대신 시퀀스 정보와 이름을 입력받는 란은 수기로 입력할때만 받으므로(FASTA, Genbank는 그 안에 정보가 다 있어서 Biopython으로 가져올 수 있다) 그 부분에 대한 처리가 별도로 필요하다. 어려운 건 아니고, 라디오버튼이 활성되었을 때만 입력할 수 있게 해 주면 된다.
다음번에는 유효성 검사를 추가해야지…
그래서 여기까지 됐다.
'Coding > Python' 카테고리의 다른 글
Python으로 60갑자 뽑기 (0) | 2022.09.23 |
---|---|
RE with FLASK-유효성 검사 (0) | 2022.08.24 |
RE with FLASK-Cutter/Finder (0) | 2022.08.22 |
RE with FLASK-Searcher 이식하기 (0) | 2022.08.22 |
RE with FLASK-뼈대 대공사 (0) | 2022.08.22 |
이 다음이 스크립트랑 함수파트인데...
함수 정의하고 스크립트 실행하는게 링크가 없다...
뭐 어쩌라는겨...
아 참고로 이번에도 라이브러리 하나 깔아야됩니다
install.packages("ellipse")
ㅇㅋ ㄱㄱ
Correlation matrix
사실 여기는 이거 하나밖에 없음...ㅋㅋㅋㅋㅋㅋ
근데 내가 이걸 어디서 본 것 같은디... (가물가물)
> set.seed(955)
> vvar <- 1:20 + rnorm(20,sd=3)
> wvar <- 1:20 + rnorm(20,sd=5)
> xvar <- 20:1 + rnorm(20,sd=3)
> yvar <- (1:20)/2 + rnorm(20, sd=10)
> zvar <- rnorm(20, sd=6)
난수를 뭐 이렇게 많이 만드냐...
> data <- data.frame(vvar, wvar, xvar, yvar, zvar)
> head(data)
vvar wvar xvar yvar zvar
1 -4.252354 5.1219288 16.02193 -15.156368 -4.086904
2 1.702318 -1.3234340 15.83817 -24.063902 3.468423
3 4.323054 -2.1570874 19.85517 2.306770 -3.044931
4 1.780628 0.7880138 17.65079 2.564663 1.449081
5 11.537348 -1.3075994 10.93386 9.600835 2.761963
6 6.672130 2.0135190 15.24350 -3.465695 5.749642
이걸 굳이 데이터프레임까지 만들어야 하냐...
> library(ellipse)
다음의 패키지를 부착합니다: ‘ellipse’
The following object is masked from ‘package:car’:
ellipse
The following object is masked from ‘package:graphics’:
pairs
그리고 새기들아 깔아야 되는 라이브러리는 미리 말하라고...
> ctab=cor(data)
> round(ctab,2)
vvar wvar xvar yvar zvar
vvar 1.00 0.61 -0.85 0.75 -0.21
wvar 0.61 1.00 -0.81 0.54 -0.31
xvar -0.85 -0.81 1.00 -0.63 0.24
yvar 0.75 0.54 -0.63 1.00 -0.30
zvar -0.21 -0.31 0.24 -0.30 1.00
아무튼 그려봅시다
> plotcorr(ctab,mar=c(0.1,0.1,0.1,0.1))
어 때깔이... 흑백이네?
> colorfun=colorRamp(c("#f7cac9","#5f4b8b","#91a8d1"),space="Lab")
> plotcorr(ctab,col=rgb(colorfun((ctab+1)/2),maxColorValue=255),mar=c(0.1,0.1,0.1,0.1))
내가 색깔을 잘못 잡았나본데...?
아무튼 그래요... 저거 근데 보통 히트맵으로 그리지 않음?
'Coding > R' 카테고리의 다른 글
R 배워보기-8.3. Basic graphs with standard graphics (0) | 2022.08.23 |
---|---|
R 배워보기-8.2. Miscellaneous (0) | 2022.08.23 |
R 배워보기-번외편: R로 standard curve 그리기 (0) | 2022.08.22 |
R의 내장 데이터 (부제: 공공데이터 어떻게 받아요?) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (하) (0) | 2022.08.22 |
참고로 이번꺼는 ggplot 안 데려와도 된다.
근데 라이브러리 깔긴 해야됨...
install.packages("sm")
install.packages("car")
네 두개 깔고 오세여.
히스토그램과 밀도 곡선
> set.seed(1)
> rating=rnorm(200)
> head(rating)
[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
> rating2=rnorm(200,mean=.8)
> head(rating2)
[1] 1.2094018 2.4888733 2.3865884 0.4690922 -1.4852355 3.2976616
다들 이쯤되면 알잖음? 히스토그램은 역사와 전통의 난수생성...
> cond=factor(rep(c("A","B"),each=200))
> data=data.frame(cond,rating=(c(rating,rating2)))
> head(data)
cond rating
1 A -0.6264538
2 A 0.1836433
3 A -0.8356286
4 A 1.5952808
5 A 0.3295078
6 A -0.8204684
근데 이게 데이터프레임까지 만들 일이냐?
> hist(rating)
기본적인 히스토그램은 이렇게 생겼다.
> hist(rating,breaks=8,col="#ccccff",freq=FALSE)
색깔 말고 다를게 없는디?
> boundaries=seq(-3,3.6,by=.6)
> boundaries
[1] -3.0 -2.4 -1.8 -1.2 -0.6 0.0 0.6 1.2 1.8 2.4 3.0 3.6
> hist(rating,breaks=boundaries)
밀도? 아 그 빈도 간격 간격
아무튼 그것도 조절 가능함..
밀도 곡선
> plot(density(rating))
밀도 곡선도 된다.
plot.multi.dens <- function(s)
{
junk.x = NULL
junk.y = NULL
for(i in 1:length(s)) {
junk.x = c(junk.x, density(s[[i]])$x)
junk.y = c(junk.y, density(s[[i]])$y)
}
xr <- range(junk.x)
yr <- range(junk.y)
plot(density(s[[1]]), xlim = xr, ylim = yr, main = "")
for(i in 1:length(s)) {
lines(density(s[[i]]), xlim = xr, ylim = yr, col = i)
}
}
사전에 함수 정의하면
> plot.multi.dens( list(rating, rating2))
이거 그럼 함수 정의 안하면 두개 안된다는 얘기 아니냐...
> library(sm)
Package 'sm', version 2.2-5.7: type help(sm) for summary information
> sm.density.compare(data$rating,data$cond)
sm 라이브러리 불러온게 훨 낫네.
산점도
> set.seed(2)
> dat <- data.frame(xvar = 1:20 + rnorm(20,sd=3),
+ yvar = 1:20 + rnorm(20,sd=3),
+ zvar = 1:20 + rnorm(20,sd=3))
(대충 난수 만들었다는 얘기)
> plot(dat$xvar,dat$yvar)
평범한 산점도는 이렇게 생겼다. 그럼 회귀곡선 되나요?
> fitline=lm(dat$xvar~dat$yvar)
> abline(fitline)
예 됩니다. 아 참고로 산점도 그리는 코드가 두 가지인데 하나는 위에 있고 다른 하나가
> plot(xvar~zvar,dat)
이거다.
산점도 매트릭스
아누형 나올 것 같잖아 산점도에서 키아누 리브스 나오냐고
> plot(dat[,1:3])
아니 근데 이거 어케 해석하는겨 ㄷㄷ
> library(car)
필요한 패키지를 로딩중입니다: carData
> scatterplotMatrix(dat[,1:3],diagonal="histogram",smooth=FALSE)
경고메시지(들):
In applyDefaults(diagonal, defaults = list(method = "adaptiveDensity"), :
unnamed diag arguments, will be ignored
car 라이브러리 불러오면 이런것도 된다. ...뭐야 내 히스토그램 돌려줘요!
박스 그래프
> boxplot(len~supp,data=ToothGrowth)
내장 데이터인 ToothGrowth를 써 볼건데...
이게 len/supp boxplot이고
이건 len/dose 그래프이다. 근데 아니 이거 일일이 그리기 귀찮은데 한번에 안돼요?
> boxplot(len~interaction(dose,supp),data=ToothGrowth)
야 이럴거면 ggplot은 왜 까냐... 색깔 입히려고
> plot(len~interaction(dose,supp),data=ToothGrowth)
참고로 이것도 같은 코드다.
Q-Q plot
이거 근데 뭐 하는 그래프냐...
> set.seed(3)
> x=rnorm(80,mean=50,sd=5)
> z=runif(80)
일단 난수부터 만들고 시작해보자.
> qqnorm(x)
이렇게 하면 qqplot이 나온다.
> qqline(x)
얘까지 하면 선이 보인다.
> qqnorm(x^4)
> qqline(x^4)
(같은 그래프 우려먹기 아님)
> qqnorm(z)
> qqline(z)
(변수 바꿨음)
'Coding > R' 카테고리의 다른 글
R 배워보기-8.4. Other interesting graphs (0) | 2022.08.23 |
---|---|
R 배워보기-8.2. Miscellaneous (0) | 2022.08.23 |
R 배워보기-번외편: R로 standard curve 그리기 (0) | 2022.08.22 |
R의 내장 데이터 (부제: 공공데이터 어떻게 받아요?) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (하) (0) | 2022.08.22 |
이거는 솔직히 8.1에 비하면 분량은 짧아요...
근데 ggplot은 불러야됨
그래프를 저⭐장
그래프 두갠가 그리긴 했음... 제주도 야채 서브셋으로...
> pdf("plots.pdf")
> plot(plot)
50건 이상의 경고들을 발견되었습니다 (이들 중 처음 50건을 확인하기 위해서는 warnings()를 이용하시길 바랍니다).
> dev.off()
pdf("파일명.pdf")만 쓰면 빈 pdf파일이 나오고 밑에 저장할 그래프를 하나씩 쓰면 페이지당 하나씩 저장된다.
> pdf("plots.pdf")
> plot(plot)
50건 이상의 경고들을 발견되었습니다 (이들 중 처음 50건을 확인하기 위해서는 warnings()를 이용하시길 바랍니다).
> plot(plot2)
50건 이상의 경고들을 발견되었습니다 (이들 중 처음 50건을 확인하기 위해서는 warnings()를 이용하시길 바랍니다).
> dev.off()
X11cairo
2
그게 무슨말이냐면 여러개도 된다는 소리지.
# 6x3 inches
pdf("plots.pdf", width=6, height=3)
# 10x6 cm
pdf("plots.pdf", width=10/2.54, height=6/2.54)
아니 새기들아 미터법 안쓰냐고
> svg("plot.svg")
> plot(plot)
> dev.off()
X11cairo
2
svg는 이거
> png("plot.png")
> plot(plot)
> dev.off()
X11cairo
2
png는 이거
> png("plot.tiff")
> plot(plot2)
> dev.off()
X11cairo
2
tiff는 이거다.
png("plot.png", width=480, height=240, res=120)
plot(...)
dev.off()
얘는 픽셀로 받는갑다.
점과 선 모양
이렇다고 합니다.
글꼴
(진짜 짤 제조기 만드신 분 복받으세요)
글꼴 바꿀 수 있더라...
> plot2=ggplot(data=data_carrot,aes(x=연산,y=조수입.백만원.,fill=연산))+geom_bar(stat="identity")+geom_text(y=70000,label="Carrot",family="Courier")
대충 이런 식으로 바꿉니다. Courier는 courier new같은데 저 폰트 시퀀스 파일 저장할 때 많이 써먹음. 고정폭이라 일정 bp가 한 줄을 차지해서 좋습니다. 아무튼...
> plot2=ggplot(data=data_carrot,aes(x=연산,y=조수입.백만원.,fill=연산))+geom_bar(stat="identity")+geom_text(y=70000,label="Carrot",family="나눔손글씨 바른히피")
> plot2
근데 이건 왜 되는거임?
> plot2=ggplot(data=data_carrot,aes(x=연산,y=조수입.백만원.,fill=연산))+geom_bar(stat="identity")+geom_text(y=70000,label="Carrot",family="나눔손글씨 바른히피")+ggtitle("제주도 당근 현황")+theme(plot.title=element_text(family="나눔손글씨 바른히피",face="bold",size=18))
아니 왜 돼요?
> plot=ggplot(data=data_cabbage,aes(x=연산,y=조수입.백만원.,fill=연산))+geom_bar(stat="identity")+geom_text(x=2,y=110000,label="Cabbage",family="나눔손글씨 바른히피")+ggtitle("제주도 당근 현황")+theme(plot.title=element_text(family="나눔손글씨 바른히피",face="bold",size=18))+theme(axis.title.x=element_text(family="나눔손글씨 바른히피"))+theme(axis.title.y=element_text(family="나눔손글씨 바른히피"))
궁서체로 왜 됨???
ggplot(data=data_cabbage,aes(x=연산,y=조수입.백만원.,fill=연산))+geom_bar(stat="identity")+geom_text(x=2,y=110000,label="Cabbage",family="나눔손글씨 바른히피")+ggtitle("제주도 당근 현황")+theme(plot.title=element_text(family="나눔손글씨 바른히피",face="bold",size=18))+theme(axis.title.x=element_text(family="나눔손글씨 바른히피"))+theme(axis.title.y=element_text(family="나눔손글씨 바른히피"))+theme(legend.title=element_text(family="나눔손글씨 바른히피"))+theme(legend.text=element_text(family="나눔손글씨 바른히피"))+theme(axis.text.x=element_text(family="나눔손글씨 바른히피"))+theme(axis.text.y=element_text(family="나눔손글씨 바른히피"))
아니 진짜 이렇게 된다고?????? 아니 실화냐고
'Coding > R' 카테고리의 다른 글
R 배워보기-8.4. Other interesting graphs (0) | 2022.08.23 |
---|---|
R 배워보기-8.3. Basic graphs with standard graphics (0) | 2022.08.23 |
R 배워보기-번외편: R로 standard curve 그리기 (0) | 2022.08.22 |
R의 내장 데이터 (부제: 공공데이터 어떻게 받아요?) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (하) (0) | 2022.08.22 |
https://blog.naver.com/pokemonms/222606583751
Bradford assay는 단백질의 무게를 확인하기 위해 진행하는 실험이다. Bradford assay용 시약을 섞고 OD595를 재면 되는데, 그러기 위해서 Standard curve가 필요하다. 일정한 무게의 단백질(BSA; Bovine serum albumin)을 용해한 다음 Bradford assay용 시약을 섞고 OD595를 측정하고,
이런 식으로 standard curve를 그린다. 이게 없으면 OD595를 재도 무게가 어느 정도인지 모른다.
실험수업을 듣는 제육쌈밥(대짱이)군, 이번 주 실험 주제는 Bradford assay였다. standard curve를 그리고 미지 시료의 단백질 농도까지 정량하는 게 이번 과제였다. 그런데 양을 측정하려면 먼저 standard curve를 그리고, 선형 회귀분석을 통해(엑셀에서는 추세선) R^2와 일차식을 구해야 하지 않겠는가? 하지만 제육쌈밥군의 컴퓨터는 리눅스였고, 하필 그날따라 리브레오피스가 버벅거리는 것이었다. (이거 생각보다 버벅거림)
그리고 이걸로도 어떻게든 되겠지, 하면서 제육쌈밥군은 R을 켰다. 근데 왜 이름이 제육쌈밥이죠 아니 그냥 그게 생각나서요 이름 진짜 막 지으시네
그래프 그리기 전단계
> library(ggplot2)
> setwd('/home/koreanraichu/')
어디가요 ggplot2 불러야지
setwd는 working directory 설정하는건데, 본인은 저기에 파일이 있어서 저기로 고정해두고 쓴다. 고정 안 해두면 '/home/koreanraichu/파일.csv'로 열어야 하지만, 고정하게 되면 '파일명.csv' 한방이면 끝.
> data=read.csv('bradford.csv')
> data
BSA OD595_1 OD595_2 OD595_3
1 0 0.001 0.000 0.000
2 10 0.005 0.006 0.004
3 50 0.035 0.030 0.027
4 100 0.050 0.051 0.055
5 200 0.089 0.091 0.095
불러서 일단 평균부터 구해야 한다.
> data$AVR=rowMeans(data[,c('OD595_1','OD595_2','OD595_3')])
> data
BSA OD595_1 OD595_2 OD595_3 AVR
1 0 0.001 0.000 0.000 0.0003333333
2 10 0.005 0.006 0.004 0.0050000000
3 50 0.035 0.030 0.027 0.0306666667
4 100 0.050 0.051 0.055 0.0520000000
5 200 0.089 0.091 0.095 0.0916666667
(마른세수)
> data$AVR=round(rowMeans(data[,c('OD595_1','OD595_2','OD595_3')]),3)
> data
BSA OD595_1 OD595_2 OD595_3 AVR
1 0 0.001 0.000 0.000 0.000
2 10 0.005 0.006 0.004 0.005
3 50 0.035 0.030 0.027 0.031
4 100 0.050 0.051 0.055 0.052
5 200 0.089 0.091 0.095 0.092
(대충 개비스콘 아저씨 편안 짤)
꺾은선그래프
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line()
씁 근데 색이 좀 그래...
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line(colour="#939597")
아 얼티메이트 그레이는 킹정이죠
이모 여기 추세선 1인분!
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line(colour="#939597")+geom_smooth(method=lm,se=FALSE)
`geom_smooth()` using formula 'y ~ x'
method=lm으로 하면 직선형이 나온다. 아무튼 그렸으면 봅시다...
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line(colour="#939597")+geom_smooth(method=lm,se=FALSE,colour="#000000")
`geom_smooth()` using formula 'y ~ x'
뭐야 이거 왜 돼요
추세선 식과 R^2
> summary(lm(AVR~BSA,data))
Call:
lm(formula = AVR ~ BSA, data = data)
Residuals:
1 2 3 4 5
-0.002969 -0.002556 0.005093 0.003154 -0.002723
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.969e-03 2.776e-03 1.069 0.363366
BSA 4.588e-04 2.707e-05 16.948 0.000447 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.004421 on 3 degrees of freedom
Multiple R-squared: 0.9897, Adjusted R-squared: 0.9862
F-statistic: 287.2 on 1 and 3 DF, p-value: 0.0004474
BSA가 X축, Intercept는 절편(Y절편)이다. R^2는 Multiple R-squared에 있다.
> 4.588e-04
[1] 0.0004588
> 2.969e-03
[1] 0.002969
표시형식 왜저래요... 아무튼 이 추세선의 식은 y=0.0004588x+0.002969 되시겠다.
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line(colour="#939597")+geom_smooth(method=lm,se=FALSE,colour="#000000")+geom_text(x=100,y=0.08,label="y=0.0004588x+0.002969")+geom_text(x=100,y=0.077,label="R^2=0.9897")
`geom_smooth()` using formula 'y ~ x'
그래프에 넣을거면 geom_text()를 쓰자. ...아니 자꾸 점으로 읽어...
축 제목과 그래프 제목
여기까지 다 그린 제육쌈밥군. 됐다! 하고 그래프를 저장하고 R을 끄려다가 생각해보니, 축 제목이 좀 그렇다?
> ggplot(data=data,aes(x=BSA,y=AVR,group=1))+geom_line(colour="#939597")+geom_smooth(method=lm,se=FALSE,colour="#000000")+geom_text(x=100,y=0.08,label="y=0.0004588x+0.002969")+geom_text(x=100,y=0.077,label="R^2=0.9897")+xlab("BSA conc. (ug/ul)")+ylab("OD 595")+ggtitle("Standard curve")
`geom_smooth()` using formula 'y ~ x'
축 제목을 바꿔주고 그래프 제목을 추가했다.
'Coding > R' 카테고리의 다른 글
R 배워보기-8.3. Basic graphs with standard graphics (0) | 2022.08.23 |
---|---|
R 배워보기-8.2. Miscellaneous (0) | 2022.08.23 |
R의 내장 데이터 (부제: 공공데이터 어떻게 받아요?) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (하) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (상) (0) | 2022.08.22 |
실습용 데이터는 어지간하면 가상으로 만드는 편이지만, R에는 내장데이터가 겁나 풍부하다. 무슨 패키지 깔면 데이터 드리는 수준...
오늘은 그래서 본인 컴퓨터에 있는 R 내장 데이터 목록을 싹 털었다. 덤으로 ggplot편에 나온 데이터 출처 가르쳐드림.
들어가기 전에
소환하고 싶은 내장 데이터가 있다면
> dat=data(BJsales)
걍 이렇게 부르면 된다.
> data(baseball)
경고메시지(들):
In data(baseball) : 데이터셋 ‘baseball’을 찾을 수 없습니다
# 라이브러리가 필요한 건 그냥 부르면 에러뜬다
> library(plyr)
> data(baseball)
# 라이브러리를 부르고 부르자
라이브러리가 있어야 하는 건 라이브러리 부르고 불러야된다..
Q. 그 데이터 으데서 받습니까?
A. 공공데이터포털이라고 있음.
여기서 데이터 찾기 들어가시면 세상천지 대한민국 데이터는 다 있음. (제주도 야채 데이터도 저기서 받음)
근데 csv파일로 제공되는 데이터 중에 한글이 깨지는게 좀 있어서 그건 조심해야 합니다. 다른 인코딩은 모르겠고 UTF-8로 했는데 꺠지는건 문제 아니냐...
R 내장 데이터 목록
boot
Data sets in package ‘boot’:
acme Monthly Excess Returns
aids Delay in AIDS Reporting in England and Wales
aircondit Failures of Air-conditioning Equipment
aircondit7 Failures of Air-conditioning Equipment
amis Car Speeding and Warning Signs
aml Remission Times for Acute Myelogenous Leukaemia
beaver Beaver Body Temperature Data
bigcity Population of U.S. Cities
brambles Spatial Location of Bramble Canes
breslow Smoking Deaths Among Doctors
calcium Calcium Uptake Data
cane Sugar-cane Disease Data
capability Simulated Manufacturing Process Data
catsM Weight Data for Domestic Cats
cav Position of Muscle Caveolae
cd4 CD4 Counts for HIV-Positive Patients
cd4.nested Nested Bootstrap of cd4 data
channing Channing House Data
city Population of U.S. Cities
claridge Genetic Links to Left-handedness
cloth Number of Flaws in Cloth
co.transfer Carbon Monoxide Transfer
coal Dates of Coal Mining Disasters
darwin Darwin's Plant Height Differences
dogs Cardiac Data for Domestic Dogs
downs.bc Incidence of Down's Syndrome in British
Columbia
ducks Behavioral and Plumage Characteristics of
Hybrid Ducks
fir Counts of Balsam-fir Seedlings
frets Head Dimensions in Brothers
grav Acceleration Due to Gravity
gravity Acceleration Due to Gravity
hirose Failure Time of PET Film
islay Jura Quartzite Azimuths on Islay
manaus Average Heights of the Rio Negro river at
Manaus
melanoma Survival from Malignant Melanoma
motor Data from a Simulated Motorcycle Accident
neuro Neurophysiological Point Process Data
nitrofen Toxicity of Nitrofen in Aquatic Systems
nodal Nodal Involvement in Prostate Cancer
nuclear Nuclear Power Station Construction Data
paulsen Neurotransmission in Guinea Pig Brains
poisons Animal Survival Times
polar Pole Positions of New Caledonian Laterites
remission Cancer Remission and Cell Activity
salinity Water Salinity and River Discharge
survival Survival of Rats after Radiation Doses
tau Tau Particle Decay Modes
tuna Tuna Sighting Data
urine Urine Analysis Data
wool Australian Relative Wool Prices
carData
Data sets in package ‘carData’:
AMSsurvey American Math Society Survey Data
Adler Experimenter Expectations
Angell Moral Integration of American Cities
Anscombe U. S. State Public-School Expenditures
Arrests Arrests for Marijuana Possession
BEPS British Election Panel Study
Baumann Methods of Teaching Reading Comprehension
Bfox Canadian Women's Labour-Force Participation
Blackmore Exercise Histories of Eating-Disordered and
Control Subjects
Burt Fraudulent Data on IQs of Twins Raised Apart
CES11 2011 Canadian National Election Study, With
Attitude Toward Abortion
CanPop Canadian Population Data
Chile Voting Intentions in the 1988 Chilean
Plebiscite
Chirot The 1907 Romanian Peasant Rebellion
Cowles Cowles and Davis's Data on Volunteering
Davis Self-Reports of Height and Weight
DavisThin Davis's Data on Drive for Thinness
Depredations Minnesota Wolf Depredation Data
Duncan Duncan's Occupational Prestige Data
Ericksen The 1980 U.S. Census Undercount
Florida Florida County Voting
Freedman Crowding and Crime in U. S. Metropolitan Areas
Friendly Format Effects on Recall
GSSvocab Data from the General Social Survey (GSS) from
the National Opinion Research Center of the
University of Chicago.
Ginzberg Data on Depression
Greene Refugee Appeals
Guyer Anonymity and Cooperation
Hartnagel Canadian Crime-Rates Time Series
Highway1 Highway Accidents
KosteckiDillon Treatment of Migraine Headaches
Leinhardt Data on Infant-Mortality
LoBD Cancer drug data use to provide an example of
the use of the skew power distributions.
Mandel Contrived Collinear Data
Migration Canadian Interprovincial Migration Data
Moore Status, Authoritarianism, and Conformity
MplsDemo Minneapolis Demographic Data 2015, by
Neighborhood
MplsStops Minneapolis Police Department 2017 Stop Data
Mroz U.S. Women's Labor-Force Participation
OBrienKaiser O'Brien and Kaiser's Repeated-Measures Data
OBrienKaiserLong O'Brien and Kaiser's Repeated-Measures Data in
"Long" Format
Ornstein Interlocking Directorates Among Major Canadian
Firms
Pottery Chemical Composition of Pottery
Prestige Prestige of Canadian Occupations
Quartet Four Regression Datasets
Robey Fertility and Contraception
Rossi Rossi et al.'s Criminal Recidivism Data
SLID Survey of Labour and Income Dynamics
Sahlins Agricultural Production in Mazulu Village
Salaries Salaries for Professors
Soils Soil Compositions of Physical and Chemical
Characteristics
States Education and Related Statistics for the U.S.
States
TitanicSurvival Survival of Passengers on the Titanic
Transact Transaction data
UN National Statistics from the United Nations,
Mostly From 2009-2011
UN98 United Nations Social Indicators Data 1998]
USPop Population of the United States
Vocab Vocabulary and Education
WVS World Values Surveys
WeightLoss Weight Loss Data
Wells Well Switching in Bangladesh
Womenlf Canadian Women's Labour-Force Participation
Wong Post-Coma Recovery of IQ
Wool Wool data
caret
Data sets in package ‘caret’:
GermanCredit German Credit Data
Sacramento Sacramento CA Home Prices
absorp (tecator) Fat, Water and Protein Content of Meat Samples
bbbDescr (BloodBrain) Blood Brain Barrier Data
cars Kelly Blue Book resale data for 2005 model year
GM cars
cox2Class (cox2) COX-2 Activity Data
cox2Descr (cox2) COX-2 Activity Data
cox2IC50 (cox2) COX-2 Activity Data
dhfr Dihydrofolate Reductase Inhibitors Data
endpoints (tecator) Fat, Water and Protein Content of Meat Samples
fattyAcids (oil) Fatty acid composition of commercial oils
logBBB (BloodBrain) Blood Brain Barrier Data
mdrrClass (mdrr) Multidrug Resistance Reversal (MDRR) Agent Data
mdrrDescr (mdrr) Multidrug Resistance Reversal (MDRR) Agent Data
oilType (oil) Fatty acid composition of commercial oils
potteryClass (pottery)
Pottery from Pre-Classical Sites in Italy
scat Morphometric Data on Scat
scat_orig (scat) Morphometric Data on Scat
segmentationData Cell Body Segmentation
cluster
Data sets in package ‘cluster’:
agriculture European Union Agricultural Workforces
animals Attributes of Animals
chorSub Subset of C-horizon of Kola Data
flower Flower Characteristics
plantTraits Plant Species Traits Data
pluton Isotopic Composition Plutonium Batches
ruspini Ruspini Data
votes.repub Votes for Republican Candidate in Presidential
Elections
xclara Bivariate Data Set with 3 Clusters
colorspace
Data sets in package ‘colorspace’:
USSouthPolygon Polygon for County Map of US South States:
Alabama, Georgia, and South Carolina
max_chroma_table Compute Maximum Chroma for Given Hue and
Luminance in HCL
datasets
Data sets in package ‘datasets’:
AirPassengers Monthly Airline Passenger Numbers 1949-1960
BJsales Sales Data with Leading Indicator
BJsales.lead (BJsales)
Sales Data with Leading Indicator
BOD Biochemical Oxygen Demand
CO2 Carbon Dioxide Uptake in Grass Plants
ChickWeight Weight versus age of chicks on different diets
DNase Elisa assay of DNase
EuStockMarkets Daily Closing Prices of Major European Stock
Indices, 1991-1998
Formaldehyde Determination of Formaldehyde
HairEyeColor Hair and Eye Color of Statistics Students
Harman23.cor Harman Example 2.3
Harman74.cor Harman Example 7.4
Indometh Pharmacokinetics of Indomethacin
InsectSprays Effectiveness of Insect Sprays
JohnsonJohnson Quarterly Earnings per Johnson & Johnson Share
LakeHuron Level of Lake Huron 1875-1972
LifeCycleSavings Intercountry Life-Cycle Savings Data
Loblolly Growth of Loblolly pine trees
Nile Flow of the River Nile
Orange Growth of Orange Trees
OrchardSprays Potency of Orchard Sprays
PlantGrowth Results from an Experiment on Plant Growth
Puromycin Reaction Velocity of an Enzymatic Reaction
Seatbelts Road Casualties in Great Britain 1969-84
Theoph Pharmacokinetics of Theophylline
Titanic Survival of passengers on the Titanic
ToothGrowth The Effect of Vitamin C on Tooth Growth in
Guinea Pigs
UCBAdmissions Student Admissions at UC Berkeley
UKDriverDeaths Road Casualties in Great Britain 1969-84
UKgas UK Quarterly Gas Consumption
USAccDeaths Accidental Deaths in the US 1973-1978
USArrests Violent Crime Rates by US State
USJudgeRatings Lawyers' Ratings of State Judges in the US
Superior Court
USPersonalExpenditure Personal Expenditure Data
UScitiesD Distances Between European Cities and Between
US Cities
VADeaths Death Rates in Virginia (1940)
WWWusage Internet Usage per Minute
WorldPhones The World's Telephones
ability.cov Ability and Intelligence Tests
airmiles Passenger Miles on Commercial US Airlines,
1937-1960
airquality New York Air Quality Measurements
anscombe Anscombe's Quartet of 'Identical' Simple Linear
Regressions
attenu The Joyner-Boore Attenuation Data
attitude The Chatterjee-Price Attitude Data
austres Quarterly Time Series of the Number of
Australian Residents
beaver1 (beavers) Body Temperature Series of Two Beavers
beaver2 (beavers) Body Temperature Series of Two Beavers
cars Speed and Stopping Distances of Cars
chickwts Chicken Weights by Feed Type
co2 Mauna Loa Atmospheric CO2 Concentration
crimtab Student's 3000 Criminals Data
discoveries Yearly Numbers of Important Discoveries
esoph Smoking, Alcohol and (O)esophageal Cancer
euro Conversion Rates of Euro Currencies
euro.cross (euro) Conversion Rates of Euro Currencies
eurodist Distances Between European Cities and Between
US Cities
faithful Old Faithful Geyser Data
fdeaths (UKLungDeaths)
Monthly Deaths from Lung Diseases in the UK
freeny Freeny's Revenue Data
freeny.x (freeny) Freeny's Revenue Data
freeny.y (freeny) Freeny's Revenue Data
infert Infertility after Spontaneous and Induced
Abortion
iris Edgar Anderson's Iris Data
iris3 Edgar Anderson's Iris Data
islands Areas of the World's Major Landmasses
ldeaths (UKLungDeaths)
Monthly Deaths from Lung Diseases in the UK
lh Luteinizing Hormone in Blood Samples
longley Longley's Economic Regression Data
lynx Annual Canadian Lynx trappings 1821-1934
mdeaths (UKLungDeaths)
Monthly Deaths from Lung Diseases in the UK
morley Michelson Speed of Light Data
mtcars Motor Trend Car Road Tests
nhtemp Average Yearly Temperatures in New Haven
nottem Average Monthly Temperatures at Nottingham,
1920-1939
npk Classical N, P, K Factorial Experiment
occupationalStatus Occupational Status of Fathers and their Sons
precip Annual Precipitation in US Cities
presidents Quarterly Approval Ratings of US Presidents
pressure Vapor Pressure of Mercury as a Function of
Temperature
quakes Locations of Earthquakes off Fiji
randu Random Numbers from Congruential Generator
RANDU
rivers Lengths of Major North American Rivers
rock Measurements on Petroleum Rock Samples
sleep Student's Sleep Data
stack.loss (stackloss)
Brownlee's Stack Loss Plant Data
stack.x (stackloss) Brownlee's Stack Loss Plant Data
stackloss Brownlee's Stack Loss Plant Data
state.abb (state) US State Facts and Figures
state.area (state) US State Facts and Figures
state.center (state) US State Facts and Figures
state.division (state)
US State Facts and Figures
state.name (state) US State Facts and Figures
state.region (state) US State Facts and Figures
state.x77 (state) US State Facts and Figures
sunspot.month Monthly Sunspot Data, from 1749 to "Present"
sunspot.year Yearly Sunspot Data, 1700-1988
sunspots Monthly Sunspot Numbers, 1749-1983
swiss Swiss Fertility and Socioeconomic Indicators
(1888) Data
treering Yearly Treering Data, -6000-1979
trees Diameter, Height and Volume for Black Cherry
Trees
uspop Populations Recorded by the US Census
volcano Topographic Information on Auckland's Maunga
Whau Volcano
warpbreaks The Number of Breaks in Yarn during Weaving
women Average Heights and Weights for American Women
doBy
Data sets in package ‘doBy’:
NIRmilk NIRmilk
beets beets data
breastcancer Gene expression signatures for p53 mutation
status in 250 breast cancer samples
budworm budworm data
carcass Lean meat contents of 344 pig carcasses
carcassall Lean meat contents of 344 pig carcasses
codstom Diet of Atlantic cod in the Gulf of St.
Lawrence (Canada)
crimeRate crimeRate
cropyield Yield from Danish agricultural production of
grain and root crop.
dietox Growth curves of pigs in a 3x3 factorial
experiment
fatacid Fish oil in pig food
fev Forced expiratory volume in children
haldCement Heat development in cement under hardening.
math Mathematics marks for students
mathmark Mathematics marks for students
milkman Milk yield data for manually milked cows.
milkman_rdm1 Milk yield data for manually milked cows.
potatoes Weight and size of 20 potatoes
dplyr
Data sets in package ‘dplyr’:
band_instruments Band membership
band_instruments2 Band membership
band_members Band membership
starwars Starwars characters
storms Storm tracks data
ggplot2
Data sets in package ‘ggplot2’:
diamonds Prices of over 50,000 round cut diamonds
economics US economic time series
economics_long US economic time series
faithfuld 2d density estimate of Old Faithful data
luv_colours 'colors()' in Luv space
midwest Midwest demographics
mpg Fuel economy data from 1999 to 2008 for 38
popular models of cars
msleep An updated and expanded version of the mammals
sleep dataset
presidential Terms of 11 presidents from Eisenhower to Obama
seals Vector field of seal movements
txhousing Housing sales in TX
ipred
Data sets in package ‘ipred’:
DLBCL Diffuse Large B-Cell Lymphoma
GlaucomaMVF Glaucoma Database
Smoking Smoking Styles
dystrophy Detection of muscular dystrophy carriers.
irr
Data sets in package ‘irr’:
anxiety Anxiety ratings by different raters
diagnoses Psychiatric diagnoses provided by different
raters
video Different raters judging the credibility of
videotaped testimonies
vision Eye-testing case records
lattice
Data sets in package ‘lattice’:
USMortality Mortality Rates in US by Cause and Gender
USRegionalMortality Mortality Rates in US by Cause and Gender
barley Yield data from a Minnesota barley trial
environmental Atmospheric environmental conditions in New
York City
ethanol Engine exhaust fumes from burning ethanol
melanoma Melanoma skin cancer incidence
singer Heights of New York Choral Society singers
lava
Data sets in package ‘lava’:
bmd Longitudinal Bone Mineral Density Data (Wide
format)
bmidata Data
brisa Simulated data
calcium Longitudinal Bone Mineral Density Data
hubble Hubble data
hubble2 Hubble data
indoorenv Data
missingdata Missing data example
nldata Example data (nonlinear model)
nsem Example SEM data (nonlinear)
semdata Example SEM data
serotonin Serotonin data
serotonin2 Data
twindata Twin menarche data
lme4
Data sets in package ‘lme4’:
Arabidopsis Arabidopsis clipping/fertilization data
Dyestuff Yield of dyestuff by batch
Dyestuff2 Yield of dyestuff by batch
InstEval University Lecture/Instructor Evaluations by
Students at ETH
Pastes Paste strength by batch and cask
Penicillin Variation in penicillin testing
VerbAgg Verbal Aggression item responses
cake Breakage Angle of Chocolate Cakes
cbpp Contagious bovine pleuropneumonia
grouseticks Data on red grouse ticks from Elston et al.
2001
grouseticks_agg (grouseticks)
Data on red grouse ticks from Elston et al.
2001
sleepstudy Reaction times in a sleep deprivation study
lubridate
Data sets in package ‘lubridate’:
lakers Lakers 2008-2009 basketball data set
Data sets in package ‘maptools’:
SplashDams Data for Splash Dams in western Oregon
h1pl (gpcholes) Hisaji Ono's lake/hole problem
h2pl (gpcholes) Hisaji Ono's lake/hole problem
state.vbm US State Visibility Based Map
wrld_simpl Simplified world country polygons
MASS
Data sets in package ‘MASS’:
Aids2 Australian AIDS Survival Data
Animals Brain and Body Weights for 28 Species
Boston Housing Values in Suburbs of Boston
Cars93 Data from 93 Cars on Sale in the USA in 1993
Cushings Diagnostic Tests on Patients with Cushing's
Syndrome
DDT DDT in Kale
GAGurine Level of GAG in Urine of Children
Insurance Numbers of Car Insurance claims
Melanoma Survival from Malignant Melanoma
OME Tests of Auditory Perception in Children with
OME
Pima.te Diabetes in Pima Indian Women
Pima.tr Diabetes in Pima Indian Women
Pima.tr2 Diabetes in Pima Indian Women
Rabbit Blood Pressure in Rabbits
Rubber Accelerated Testing of Tyre Rubber
SP500 Returns of the Standard and Poors 500
Sitka Growth Curves for Sitka Spruce Trees in 1988
Sitka89 Growth Curves for Sitka Spruce Trees in 1989
Skye AFM Compositions of Aphyric Skye Lavas
Traffic Effect of Swedish Speed Limits on Accidents
UScereal Nutritional and Marketing Information on US
Cereals
UScrime The Effect of Punishment Regimes on Crime Rates
VA Veteran's Administration Lung Cancer Trial
abbey Determinations of Nickel Content
accdeaths Accidental Deaths in the US 1973-1978
anorexia Anorexia Data on Weight Change
bacteria Presence of Bacteria after Drug Treatments
beav1 Body Temperature Series of Beaver 1
beav2 Body Temperature Series of Beaver 2
biopsy Biopsy Data on Breast Cancer Patients
birthwt Risk Factors Associated with Low Infant Birth
Weight
cabbages Data from a cabbage field trial
caith Colours of Eyes and Hair of People in Caithness
cats Anatomical Data from Domestic Cats
cement Heat Evolved by Setting Cements
chem Copper in Wholemeal Flour
coop Co-operative Trial in Analytical Chemistry
cpus Performance of Computer CPUs
crabs Morphological Measurements on Leptograpsus
Crabs
deaths Monthly Deaths from Lung Diseases in the UK
drivers Deaths of Car Drivers in Great Britain 1969-84
eagles Foraging Ecology of Bald Eagles
epil Seizure Counts for Epileptics
farms Ecological Factors in Farm Management
fgl Measurements of Forensic Glass Fragments
forbes Forbes' Data on Boiling Points in the Alps
galaxies Velocities for 82 Galaxies
gehan Remission Times of Leukaemia Patients
genotype Rat Genotype Data
geyser Old Faithful Geyser Data
gilgais Line Transect of Soil in Gilgai Territory
hills Record Times in Scottish Hill Races
housing Frequency Table from a Copenhagen Housing
Conditions Survey
immer Yields from a Barley Field Trial
leuk Survival Times and White Blood Counts for
Leukaemia Patients
mammals Brain and Body Weights for 62 Species of Land
Mammals
mcycle Data from a Simulated Motorcycle Accident
menarche Age of Menarche in Warsaw
michelson Michelson's Speed of Light Data
minn38 Minnesota High School Graduates of 1938
motors Accelerated Life Testing of Motorettes
muscle Effect of Calcium Chloride on Muscle
Contraction in Rat Hearts
newcomb Newcomb's Measurements of the Passage Time of
Light
nlschools Eighth-Grade Pupils in the Netherlands
npk Classical N, P, K Factorial Experiment
npr1 US Naval Petroleum Reserve No. 1 data
oats Data from an Oats Field Trial
painters The Painter's Data of de Piles
petrol N. L. Prater's Petrol Refinery Data
phones Belgium Phone Calls 1950-1973
quine Absenteeism from School in Rural New South
Wales
road Road Accident Deaths in US States
rotifer Numbers of Rotifers by Fluid Density
ships Ships Damage Data
shoes Shoe wear data of Box, Hunter and Hunter
shrimp Percentage of Shrimp in Shrimp Cocktail
shuttle Space Shuttle Autolander Problem
snails Snail Mortality Data
steam The Saturated Steam Pressure Data
stormer The Stormer Viscometer Data
survey Student Survey Data
synth.te Synthetic Classification Problem
synth.tr Synthetic Classification Problem
topo Spatial Topographic Data
waders Counts of Waders at 15 Sites in South Africa
whiteside House Insulation: Whiteside's Data
wtloss Weight Loss Data from an Obese Patient
Matrix
Data sets in package ‘Matrix’:
CAex Albers' example Matrix with "Difficult" Eigen
Factorization
KNex Koenker-Ng Example Sparse Model Matrix and
Response Vector
USCounties USCounties Contiguity Matrix
wrld_1deg World 1-degree grid contiguity matrix
mgcv
Data sets in package ‘mgcv’:
columb Reduced version of Columbus OH crime data
columb.polys Reduced version of Columbus OH crime data
ModelMetrices
Data sets in package ‘ModelMetrics’:
testDF Test data
nlme
Data sets in package ‘nlme’:
Alfalfa Split-Plot Experiment on Varieties of Alfalfa
Assay Bioassay on Cell Culture Plate
BodyWeight Rat weight over time for different diets
Cefamandole Pharmacokinetics of Cefamandole
Dialyzer High-Flux Hemodialyzer
Earthquake Earthquake Intensity
Fatigue Cracks caused by metal fatigue
Gasoline Refinery yield of gasoline
Glucose Glucose levels over time
Glucose2 Glucose Levels Following Alcohol Ingestion
Gun Methods for firing naval guns
IGF Radioimmunoassay of IGF-I Protein
Machines Productivity Scores for Machines and Workers
MathAchSchool School demographic data for MathAchieve
MathAchieve Mathematics achievement scores
Meat Tenderness of meat
Milk Protein content of cows' milk
Muscle Contraction of heart muscle sections
Nitrendipene Assay of nitrendipene
Oats Split-plot Experiment on Varieties of Oats
Orthodont Growth curve data on an orthdontic measurement
Ovary Counts of Ovarian Follicles
Oxboys Heights of Boys in Oxford
Oxide Variability in Semiconductor Manufacturing
PBG Effect of Phenylbiguanide on Blood Pressure
Phenobarb Phenobarbitol Kinetics
Pixel X-ray pixel intensities over time
Quinidine Quinidine Kinetics
Rail Evaluation of Stress in Railway Rails
RatPupWeight The weight of rat pups
Relaxin Assay for Relaxin
Remifentanil Pharmacokinetics of Remifentanil
Soybean Growth of soybean plants
Spruce Growth of Spruce Trees
Tetracycline1 Pharmacokinetics of tetracycline
Tetracycline2 Pharmacokinetics of tetracycline
Wafer Modeling of Analog MOS Circuits
Wheat Yields by growing conditions
Wheat2 Wheat Yield Trials
bdf Language scores
ergoStool Ergometrics experiment with stool types
pbkrtest
Data sets in package ‘pbkrtest’:
beets Sugar beets data
budworm budworm data
plyr
Data sets in package ‘plyr’:
baseball Yearly batting records for all major league
baseball players
ozone Monthly ozone measurements over Central
America.
pROC
Data sets in package ‘pROC’:
aSAH Subarachnoid hemorrhage data
quantreg
Data sets in package ‘quantreg’:
Bosco Boscovich Data
CobarOre Cobar Ore data
Mammals Garland(1983) Data on Running Speed of Mammals
Peirce C.S. Peirce's Auditory Response Data
barro Barro Data
engel Engel Data
gasprice Time Series of US Gasoline Prices
uis UIS Drug Treatment study data
reshape
Data sets in package ‘reshape’:
french_fries Sensory data from a french fries experiment
smiths Demo data describing the Smiths
tips Tipping data
reshape2
Data sets in package ‘reshape2’:
french_fries Sensory data from a french fries experiment.
smiths Demo data describing the Smiths.
tips Tipping data
rpart
Data sets in package ‘rpart’:
car.test.frame Automobile Data from 'Consumer Reports' 1990
car90 Automobile Data from 'Consumer Reports' 1990
cu.summary Automobile Data from 'Consumer Reports' 1990
kyphosis Data on Children who have had Corrective Spinal
Surgery
solder Soldering of Components on Printed-Circuit
Boards
solder.balance (solder)
Soldering of Components on Printed-Circuit
Boards
stagec Stage C Prostate Cancer
sp
Data sets in package ‘sp’:
Rlogo Rlogo jpeg image
gt (Rlogo) Rlogo jpeg image
meuse Meuse river data set
meuse.area River Meuse outline
meuse.grid Prediction Grid for Meuse Data Set
meuse.grid_ll Prediction Grid for Meuse Data Set,
geographical coordinates
meuse.riv River Meuse outline
SparseM
Data sets in package ‘SparseM’:
X (triogramX) A Design Matrix for a Triogram Problem
lsq Least Squares Problems in Surveying
ssanv
Data sets in package ‘ssanv’:
example.of.Fisher.exact
Object of class 'power.htest'
stringr
Data sets in package ‘stringr’:
fruit Sample character vectors for practicing string
manipulations.
sentences Sample character vectors for practicing string
manipulations.
words Sample character vectors for practicing string
manipulations.
survival
Data sets in package ‘survival’:
aml (cancer) Acute Myelogenous Leukemia survival data
bladder (cancer) Bladder Cancer Recurrences
bladder1 (cancer) Bladder Cancer Recurrences
bladder2 (cancer) Bladder Cancer Recurrences
cancer NCCTG Lung Cancer Data
capacitor (reliability)
Reliability data sets
cgd Chronic Granulotamous Disease data
cgd0 (cgd) Chronic Granulotomous Disease data
colon (cancer) Chemotherapy for Stage B/C colon cancer
cracks (reliability) Reliability data sets
diabetic Ddiabetic retinopathy
flchain Assay of serum free light chain for 7874
subjects.
gbsg (cancer) Breast cancer data sets used in Royston and
Altman (2013)
genfan (reliability) Reliability data sets
heart Stanford Heart Transplant data
ifluid (reliability) Reliability data sets
imotor (reliability) Reliability data sets
jasa (heart) Stanford Heart Transplant data
jasa1 (heart) Stanford Heart Transplant data
kidney (cancer) Kidney catheter data
leukemia (cancer) Acute Myelogenous Leukemia survival data
logan Data from the 1972-78 GSS data used by Logan
lung (cancer) NCCTG Lung Cancer Data
mgus (cancer) Monoclonal gammopathy data
mgus1 (cancer) Monoclonal gammopathy data
mgus2 (cancer) Monoclonal gammopathy data
myeloid (cancer) Acute myeloid leukemia
myeloma (cancer) Survival times of patients with multiple
myeloma
nafld1 (nafld) Non-alcohol fatty liver disease
nafld2 (nafld) Non-alcohol fatty liver disease
nafld3 (nafld) Non-alcohol fatty liver disease
nwtco Data from the National Wilm's Tumor Study
ovarian (cancer) Ovarian Cancer Survival Data
pbc Mayo Clinic Primary Biliary Cholangitis Data
pbcseq (pbc) Mayo Clinic Primary Biliary Cirrhosis,
sequential data
rats (cancer) Rat treatment data from Mantel et al
rats2 (cancer) Rat data from Gail et al.
retinopathy Diabetic Retinopathy
rhDNase rhDNASE data set
rotterdam (cancer) Breast cancer data set used in Royston and
Altman (2013)
solder Data from a soldering experiment
stanford2 (heart) More Stanford Heart Transplant data
survexp.mn (survexp) Census Data Sets for the Expected Survival and
Person Years Functions
survexp.us (survexp) Census Data Sets for the Expected Survival and
Person Years Functions
survexp.usr (survexp) Census Data Sets for the Expected Survival and
Person Years Functions
tobin Tobin's Tobit data
transplant Liver transplant waiting list
turbine (reliability) Reliability data sets
udca Data from a trial of usrodeoxycholic acid
udca1 (udca) Data from a trial of usrodeoxycholic acid
udca2 (udca) Data from a trial of usrodeoxycholic acid
uspop2 (survexp) Projected US Population
valveSeat (reliability)
Reliability data sets
veteran (cancer) Veterans' Administration Lung Cancer study
tidyr
Data sets in package ‘tidyr’:
billboard Song rankings for Billboard top 100 in the year
2000
construction Completed construction in the US in 2018
fish_encounters Fish encounters
population World Health Organization TB data
relig_income Pew religion and income survey
smiths Some data about the Smith family
table1 Example tabular representations
table2 Example tabular representations
table3 Example tabular representations
table4a Example tabular representations
table4b Example tabular representations
table5 Example tabular representations
us_rent_income US rent and income data
who World Health Organization TB data
world_bank_pop Population data from the world bank
'Coding > R' 카테고리의 다른 글
R 배워보기-8.2. Miscellaneous (0) | 2022.08.23 |
---|---|
R 배워보기-번외편: R로 standard curve 그리기 (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (하) (0) | 2022.08.22 |
R 배워보기-8.1. ggplot2로 그래프 그리기 (상) (0) | 2022.08.22 |
R 배워보기-7. Statistical analysis (하) (0) | 2022.08.21 |