#################################### ### Calculando Missing landmarks ### #################################### # Clear plots if(!is.null(dev.list())) dev.off() # Clear console cat("\014") # Clean workspace rm(list=ls()) #Checking and clean memory use gc() ################################# getwd() setwd("G:/Meu Drive/Artigo O. destructor/TPSs/Finais (landmarks calculados)/Mandíbulas/NMNH") # (1) Loading packages install.packages("geomorph") sessionInfo() #check which packages are load library(geomorph) # (2) Read TPS file Example_landmarks<-readland.tps("NMNH_Mlateral_Landmarks_test_hueco_inventado.TPS", specID = "imageID", negNA = TRUE) dim(Example_landmarks) #check the dimension (n landmarks, 2/3d, sample size) Example_landmarks[,,1] # see the first specimen coordinates # If your TPS file has missing data you should estime or delete the individuals Example_landmarks_noNA<-estimate.missing(Example_landmarks, method = "Reg") #estimate missing data. Check the help of this function for more info. #?estimate.missing str(Example_landmarks_noNA) # (3) Create a table file to input the variables (sex, species, population, lat, long, etc...) #write.csv(pepe,file = "Variables_Callicebus_Lateral.csv") #create a table from the original tps data to make the same order writeland.tps(Example_landmarks_noNA, file = "NMNH_Mlateral_Landmarks_Test_calculados.TPS", scale = NULL, specID = TRUE)