0

i am very new with R i want to write data of pca but i found an error which is given below how can i resolve this problem kindly help me.

pc <- pca.xyz(xyz[,ca.inds$xyz])
write.table(pc, file="pc.txt", sep="\t")
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors   =  stringsAsFactors) : 
cannot coerce class ""pca"" to a data.frame
mkrieger1
  • 19,194
  • 5
  • 54
  • 65

1 Answers1

1

write.table requires a matrix or a data frame. However pca.xyz returns a list. Check the Value paragraph here to see the components it contains. If you want to save the components of a list to a file check that question

Community
  • 1
  • 1
gd047
  • 29,749
  • 18
  • 107
  • 146