Skip to content
Prev 281007 / 398503 Next

convert variable types when creating data frame from cor.test results

Hi
c("Individual_ID",
"data.frame")
temp$FeatherPosition,
The problem is that transposing a sapply object transforms it to matrix 
and matrix can have only one type of values.

Not very sophisticated but this

result <- unlist(sapply(wing.list, function(temp) cor.test(temp$Delta13C, 
temp$FeatherPosition, method="pearson"))[c(3,4,9),])

gives you a numeric vector of desired values. You can change it to numeric 
matrix

dim(result)<-c(4,2)

Give the propper name to rows and columns and/or transpose according to 
your wish.

Regards
Petr
*******************************************************************************************
2224716
http://www.R-project.org/posting-guide.html