-1

I'm trying to run a packaged called CCTPack. However it seems R is giving me a weird error saying that the data have missing values when it has none.

''Likely variables with missing values are   
Error in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate,  : 
  I am sorry: missing values (NAs) in the correlation matrix do not allow me to continue.
Please drop those variables and try again.''

I am starting to think it's some kind of import issue.. cause I've run this model a month ago and the model is running from the data I've imported before, but its keep giving me the same error with new data. I've even tried exporting the old data that's working and then importing it again. it gave me the same error...

user438383
  • 5,716
  • 8
  • 28
  • 43
  • 3
    I guess you fully expect us to be able to inform on code we have that uses data we don't see? Please make this question *reproducible*. This includes sample code you've attempted (including listing non-base R packages, and any errors/warnings received), sample *unambiguous* data (e.g., `data.frame(x=...,y=...)` or the output from `dput(head(x))` into a [code block]), and intended output given that input. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Aug 26 '23 at 17:47
  • that should have started with *"... on code we **don't** have"* – r2evans Aug 26 '23 at 18:15
  • The model started working again once I moved the datafile to a certain folder....must be somesort of error from Onedrive cloud issue ... – reresearchgames Aug 26 '23 at 18:51
  • I've seen many problems on windows trying to use files that are in a OneDrive (or similar) sync-mount. I don't know how windows does it differently than other OSes, but the bottom line is that for R on Windows, many obscure errors like this (typically during Rmd rendering) are resolved when one works 100% locally and then copies/moves scripts/results to the OneDrive directory. It's a hack. – r2evans Aug 26 '23 at 18:54
  • Okay it wasn't actually the Onedrive. It was the Package CCTPACK. I found out the reason. The package CCTPACK needs the dataset to be specifically the first column as id and first row as variable names. If I let this handled by the rstudio when I import like checking first row is variable name or first column is id, the model doesn't run and says there's something missing. So if anyone is using CCTPACK make sure imported dataset have these two. – reresearchgames Aug 26 '23 at 19:06
  • That's really good information, @reresearchgames! I think that would have value for follow-on readers, can you please (1) fill out your question so that it has a little more detail (namely the code you ran that elicited the error, as well as a short demonstration of your data so that we can see the column ordering), and (2) submit an answer to resolve your own question, including the fixed import code so that the columns are in the correct order. Thanks!! – r2evans Aug 26 '23 at 19:14
  • @r2evans do you have any more info about the clash between `rmd` and OneDrive? I face incessant problems using `rmarkdown` and `quarto` in shared folders - files being deleted randomly mostly. I've googled but I can't find anything. OneDrive is compulsory so I mostly use the workaround you suggested - local render and copy. I would love to understand what is going on. It feels to me like OneDrive treats the volume of temp files that are generated during rendering as a mini DoS attack. This also could explain why installing packages on OneDrive seems to break it. But this is just conjecture... – SamR Aug 30 '23 at 08:27
  • No, I don't. I never used OneDrive myself. – r2evans Aug 30 '23 at 10:48

1 Answers1

0

Okay it wasn't actually the Onedrive. It was the Package CCTPACK. I found out the reason. The package CCTPACK needs the dataset to be specifically the first column as id and first row as variable names. If I let this handled by the rstudio when I import like checking first row is variable name or first column is id, the model doesn't run and says there's something missing. So if anyone is using CCTPACK make sure imported dataset have these two.