I am running some PC analysis with the geomorph package on r and am trying to understand how to group my specimens. My specimens are grouped by weeks (week 1, week 5 and week 10) and I am trying to confirm that my code is indeed correct and grouping my specimens correctly. I used various coding tips from the cran file and another quick guide to geomorph.
Essentially what I did was create a csv file where each specimen has a number that corresponds to their order in the TPS file and what week they come from. My PC plots appear to be correct but I wanted to confirm that R is indeed reading my csv file correctly. I am relatively new to R so I would love some confirmation or a suggestion of some better code to be sure that week 1's points are indeed representative of week 1 specimens. I have attached a photo snip of my csv file for a sense of what that looks like (new to stack overflow and not sure what the best way to display this) Example CSV. Any input would be much appreciated, either to confirm that my code is correct or to suggest a better way to code for a grouping variable with tps files and geomorph.
setwd("/Users/tritz/Desktop/Analysis")
GP <- read.csv("W1w5w10.csv", header=T, row.names=1)
is.factor(GP$Week)
lands <- readland.tps(file.choose())
#My tps file is standard tps file, with specimen number corresponding to
#their order in this file
gpa.lands <-gpagen(lands)
View(gpa.lands)
plotAllSpecimens(lands)
gpagen(lands)
pca.lands <- plotTangentSpace(gpa.lands$coords, legend=TRUE, groups =
GP$Week)
View(pca.lands)
POST EDIT : Specific code I am asking question about
GP <- read.csv("W1w5w10.csv", header=T, row.names=1)
is.factor(GP$Week)
#This code links my csv file and I am unsure if it is reading correctly
pca.lands <- plotTangentSpace(gpa.lands$coords, legend=TRUE, groups =
GP$Week)
#here is where I generated my PC plot and linked my groups with the week
#factor in my csv