"R"의 두 판 사이의 차이
ph
잔글 (→a) |
|||
45번째 줄: | 45번째 줄: | ||
https://www.r-bloggers.com/how-to-get-the-frequency-table-of-a-categorical-variable-as-a-data-frame-in-r/ | 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