Export descriptives from Jamovi to R

134 Views Asked by At

I am using Jamovi to work on some variables of a data set from a excel file.

jmv::descriptives(
  formula = country ~ `voted`,
  data = bd,
  bar = TRUE,
  missing = FALSE,
  mean = FALSE,
  median = FALSE,
  sd = FALSE,
  min = FALSE,
  max = FALSE)

When I import the code and try to execute the code to obtain the graphics, I have the following errors:

Warning messages:
1: In FUN(X[[i]], ...) : no non-missing arguments to max; returning -Inf
2: In mean.default(x, na.rm = TRUE) :
  argument is not numeric or logical: returning NA
3: In mean.default(x, na.rm = TRUE) :
  argument is not numeric or logical: returning NA
4: In mean.default(x, na.rm = TRUE) :
  argument is not numeric or logical: returning NA
5: In var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
  NAs introduced by coercion
6: In var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
  NAs introduced by coercion
7: In var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
  NAs introduced by coercion

I am missing something?

1

There are 1 best solutions below

1
Jacob Mack On

Two issues with solutions I see:

1.) formula = country ~ voted, should be formula = 'voted', country since the variable to the left of the Tilda is the dependent variable.

2.) You should assign data = data.

Further assistance: https://www.youtube.com/watch?v=mZomeS0tLxY