"R colMeans()"의 두 판 사이의 차이

 
6번째 줄: 6번째 줄:
<syntaxhighlight lang='r' notebook>
<syntaxhighlight lang='r' notebook>
df <- read.table( header=TRUE, stringsAsFactors=FALSE, text="
df <- read.table( header=TRUE, stringsAsFactors=FALSE, text="
English Math
English Math Science
     30   60
30     60   99
     40   70
40     70   88
     50   80
50     80   77
     60   90
60     90   66
70      90   55
")
")
df
df

2021년 4월 13일 (화) 22:47 기준 최신판

1 개요[ | ]

R colMeans()
  • "열 평균", "세로 평균"
  • Form Column Means
df <- read.table( header=TRUE, stringsAsFactors=FALSE, text="
English Math Science
30      60   99
40      70   88
50      80   77
60      90   66
70      90   55
")
df
colMeans(df)
sapply(df, mean)
apply(df, 2, mean)

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}