"R"의 두 판 사이의 차이
ph
(→a) |
잔글 (→a) |
||
| (같은 사용자의 중간 판 7개는 보이지 않습니다) | |||
| 1번째 줄: | 1번째 줄: | ||
==Functions== | ==Functions== | ||
* {{c|is.na}} | * {{c|is.na}} | ||
| + | * [https://stat.ethz.ch/R-manual/R-devel/library/base/html/unique.html {{c|unique}}] | ||
| + | * [https://www.r-bloggers.com/how-to-make-a-histogram-with-basic-r/ {{c|hist}}] | ||
| − | == | + | ==quantile== |
> quantile(duration, c(.32, .57, .98)) | > quantile(duration, c(.32, .57, .98)) | ||
32% 57% 98% | 32% 57% 98% | ||
| 26번째 줄: | 28번째 줄: | ||
http://www.statmethods.net/input/exportingdata.html | http://www.statmethods.net/input/exportingdata.html | ||
| − | == | + | ==[https://cran.r-project.org/doc/manuals/R-lang.html R language definition]== |
operator등 reference찾아보기 좋다. | operator등 reference찾아보기 좋다. | ||
| − | ==a== | + | ==Frequency Table== |
| + | table | ||
| + | or | ||
| + | > library(plyr) | ||
| + | > y = count(mtcars, 'gear') | ||
| + | > y | ||
| + | gear freq | ||
| + | 1 3 15 | ||
| + | 2 4 12 | ||
| + | 3 5 5 | ||
| + | > class(y) | ||
| + | [1] "data.frame" | ||
| + | https://www.r-bloggers.com/how-to-get-the-frequency-table-of-a-categorical-variable-as-a-data-frame-in-r/ | ||
| + | |||
| + | ==The result of the previous expression== | ||
| + | .Last.value | ||
| + | https://stackoverflow.com/a/4784004/766330 | ||
| + | 아래와 같이 해두고 써도 좋다고. | ||
| + | lv <- function() .Last.value | ||
2017년 7월 31일 (월) 12:34 기준 최신판
목차
Functions
quantile
> quantile(duration, c(.32, .57, .98)) 32% 57% 98% 2.3952 4.1330 4.9330
CDF
empirical cdf : ecdf
plot(ecdf(data))
https://www.r-bloggers.com/exploratory-data-analysis-2-ways-of-plotting-empirical-cumulative-distribution-functions-in-r/ https://onlinecourses.science.psu.edu/stat464/node/84
factor to numeric
as.numeric(as.character( data ))
or
as.numeric(as.matrix( data ))
Exporting data
write.table(mydata, "c:/mydata.txt", sep="\t")
library(xlsx) write.xlsx(mydata, "c:/mydata.xlsx")
http://www.statmethods.net/input/exportingdata.html
R language definition
operator등 reference찾아보기 좋다.
Frequency Table
table
or
> library(plyr)
> y = count(mtcars, 'gear')
> y
gear freq
1 3 15
2 4 12
3 5 5
> class(y)
[1] "data.frame"
The result of the previous expression
.Last.value
https://stackoverflow.com/a/4784004/766330 아래와 같이 해두고 써도 좋다고.
lv <- function() .Last.value