0

Why does the omega function work perfectly well on my data in R and returns results without any error messages and as soon as I try knitting to html or pdf, the following error message comes up:

Error in cor(m, use = "pairwise"): 'x' must be numeric

If something is wrong with my data structure, should I not receive this error message right away in my R console? the class-comand indicates the following data structure: [1] "tbl_df" "tbl" "data.frame" which should work (and does work before knitting)?

jpsmith
  • 11,023
  • 5
  • 15
  • 36
  • Welcome to SO, DerGoblin! Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Aug 30 '23 at 17:17
  • A common mistake when rendering Rmd files is assuming that the code in the doc has access to your global environment. Any package you are using must be loaded (`library(..)`) in the document as well, and any data/objects you want it to use must be passed to it, see https://bookdown.org/yihui/rmarkdown/parameterized-reports.html. – r2evans Aug 30 '23 at 17:18

0 Answers0