Displaying 1 result from an estimated 1 matches for "datafr1".
Did you mean:
datafr
2011 Mar 18
1
help please: put output into dataframe
Dear R community members
I have been struggling on this simple question, but never get appropriate
solution. So please help.
# my data, though I have a large number of variables
var1 <- rnorm(500, 10,4)
var2 <- rnorm(500, 20, 8)
var3 <- rnorm(500, 30, 18)
var4 <- rnorm(500, 40, 20)
datafr1 <- data.frame(var1, var2, var3, var4)
# my unsuccessful codes
nvar <- ncol(datafr1)
for (i in 1:nvar) {
out1 <- NULL
out2 <- NULL
medianx <- median(getdata[,i], na.rm = TRUE)
show(madx <- mad(getdata[,i], na.rm = TRUE))...