Hello, all! I have been exploring geomorph for about a week and, so far, it does everything I want it to do, but I just ran across an odd road block that's stumping me. I run a PCA and wish to export the following three sets of resulting values to Excel:
1) pc.summary
2) pc.scores
3) pc.shapes
And I do this using the following command:
> write.xlsx(cercuspca$pc.summary, "c:/Users/asili/Documents/Cercus/TEST.xlsx")
Now, it works fine for #2 and 3, but when I try #1, I always get this specific error message:
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ""summary.prcomp"" to a data.frame
So, I finally decided to try converting the data into a geomorph data frame and then try to export it to Excel that way, so I used the command:
> testgdf <- geomorph.data.frame(shape=cercuspca$pc.summary)
And, again, it worked great with #2 and 3, but for #1, I get this:
Error in geomorph.data.frame(shape = cercuspca$pc.summary) :
Some input is either dimensionless or inappropriate for data frames
What's happening here? I'm able to call:
cercuspca$pc.summary
just fine and see the results within the console, so I could simply copy and paste the results into Excel, but I'f prefer that all my code works in harmony because I'll be running the full script with several shapes. I'm hoping I'm just overlooking something simple here...
Not sure it helps, but I'm using RStudio Version 1.0.143 on a PC running Win10.