I want to do a PCA of around 200 stone axes (In my trial I only used 2 axes to see if and how everything works). Another archaeologist suggested that I should use Momocs
in RStudio. So I took pictures of my stone tools, and using Inkscape
I digitalized the outlines. I then exported those as (black stone axes and white background, but I also have a version where I only have the outlines in black & the filling and the background are withe) JPG files.
I then wanted to do the PCA on RStudio with Momocs loaded, but I am not able to get it to work. Once I import the JPG. Files and try align, center, and scale my axes I get this message:
Error in coo_check.default(coo) : do not know how to turn into a coo
I also tried to do a Fourier analysis and a PCA without scaling, centering, and aligning, that also did not work either, I got this message after I executed the PCA command:
Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
Here are my two jpgs.
- One of the axes, black on white background
- Another axe
I know the pixel resolution on the two axes is completely different, one is much higher than the other, but it was just for a test, so I didn't bother adjusting them.
I imported my jpgs, and wanted to center, scale, and align my data before performing a PCA.
library(Momocs)
folder_path <- "~/Desktop/Test Umrisse"
image_files <- list.files(folder_path, pattern = "\\.jpg$", full.names = TRUE)
stone_axes <- import_jpg(image_files)
coo_center(stone_axes)
I expected that the two outlines would get centered, then I would scale and align them, do the fourier analysis and the PCA.