Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - ManjotV

1
R / Re: Help on PCA: Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
Hello,
One of your columns contains non-numeric information. This might be because your data frame (tdt) has a column specifying the treatment. Here is an example with the iris data set which has "Species" in column 5.

data("iris")
pca <- prcomp(iris)  # Fails with "Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric"
pca <- prcomp(iris[1:4])  # Success

Hope this helps.