I want to make a PCA in R with monthly barin values. Since there is no rain during the winter, so there are a lot of values in my column.
When I run PCA, the following message appears in the console: error in cov.wt (z): 'x' should only have a finite value
I think That R is telling me here that it does not like my 0 values
So, I tried to convert my 0 value into a 'real number', in which to multiply everything with 1.0000000001 . But even if I do this and I go again with new values, then it pops up with the same message
I have read that getting rid of those lines Anyone who can use them in any missing value (which I can not do) or a PCA code, which in some way can deal with the tempted values. But my 0 values are real, values are not missing.
I get a lot of information on the web how to deal with missing values or NA values, but nothing to deal with zero values. Does anyone have any suggestions on how I can do this? Many thanks for your help!
My guess is that "error in cov.wt (z): 'only having finite value in x Should complain that some confused are non-finite, that means NA / NAN This can happen, if you have variables that are standard deviation of 0.
Example code:
latent = rnorm (10) data = data. Frames (Representative (0, 10), # 10 0's secret + ronmore (10) #latent and noise latent + rnorm (10) # secret + 1.5 * rnorm (10)) # colnames (data) = c ("zeros", "var1", "var2", "var3") library (science) principal (Data) #Terror! Principal (data [-1]) # no error
No comments:
Post a Comment