"R"의 두 판 사이의 차이

ph
이동: 둘러보기, 검색
(새 문서: ==Functions== * {{c|is.na}} {{break}} ==percentile== > quantile(duration, c(.32, .57, .98)) 32% 57% 98% 2.3952 4.1330 4.9330 {{break}} ==CDF== empirical cdf : {{c|ecdf...)
 
잔글 (→‎a)
 
(같은 사용자의 중간 판 10개는 보이지 않습니다)
1번째 줄: 1번째 줄:
 
==Functions==
 
==Functions==
 
* {{c|is.na}}
 
* {{c|is.na}}
{{break}}
+
* [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}}]
  
==percentile==
+
==quantile==
 
  > quantile(duration, c(.32, .57, .98))  
 
  > quantile(duration, c(.32, .57, .98))  
 
     32%    57%    98%  
 
     32%    57%    98%  
 
  2.3952 4.1330 4.9330
 
  2.3952 4.1330 4.9330
{{break}}
 
  
 
==CDF==
 
==CDF==
14번째 줄: 14번째 줄:
 
https://www.r-bloggers.com/exploratory-data-analysis-2-ways-of-plotting-empirical-cumulative-distribution-functions-in-r/
 
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
 
https://onlinecourses.science.psu.edu/stat464/node/84
{{break}}
 
  
 
==factor to numeric==
 
==factor to numeric==
21번째 줄: 20번째 줄:
 
  as.numeric(as.matrix( data ))
 
  as.numeric(as.matrix( data ))
 
http://stackoverflow.com/questions/24187629/how-to-convert-factor-to-float-without-losing-precision-in-r
 
http://stackoverflow.com/questions/24187629/how-to-convert-factor-to-float-without-losing-precision-in-r
{{break}}
+
 
 +
==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
 +
 
 +
==[https://cran.r-project.org/doc/manuals/R-lang.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"
 +
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 ))

http://stackoverflow.com/questions/24187629/how-to-convert-factor-to-float-without-losing-precision-in-r

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"

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