User Tools

Site Tools


day1_exercise2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

day1_exercise2 [2017/12/13 18:08] (current)
hyjeong created
Line 1: Line 1:
 +  #1 
 +  ch = c("​0","​21","​12","​16"​) 
 +  #2 
 +  y = as.numeric(ch) 
 +  y = sort(y) 
 +  y 
 +  #3 
 +  y2 = seq(0,​24,​by=8) 
 +  y2 
 +  #4 
 +  sum((y < y2) == (y<​=y2)) 
 +  #5 
 +  x = seq(from=1,​by=2,​length=30) 
 +  x 
 +  #6 
 +  rep(c(T,​F),​times=5) 
 +  #7  
 +  sum(x[x>​10 & x<20]) 
 +  #8 
 +  xmat = matrix(x,​6,​5,​byrow=T) 
 +  #9 
 +  z = list( 
 +  sumr=apply(xmat,​1,​sum),​ 
 +  meanc=apply(xmat,​2,​mean),​ 
 +  varc=apply(xmat,​2,​var)) 
 +  z
day1_exercise2.txt · Last modified: 2017/12/13 18:08 by hyjeong