Errors reported in R : Error in x$lhs : $ operator is invalid for atomic vectors

76 views
Skip to first unread message

zerui you

unread,
Aug 29, 2023, 8:59:03 AM8/29/23
to gimme-r
Hi everyone
  • When I use gimme R package (version 0.7-13) in R version 4.3.1 on Windows 10. I always get an error. 

    The error message I receive is as follows:

fit<-gimmeSEM ( 
    data = data.list, 
out =  "./result/Data1", 
sep = ",", ar = TRUE, plot = F, subgroup=T, )

 gimme WARNING: at least one data file contains variables where the variance of one variable
              is greater than 50 times the variance of another variable. 
  We recommend rescaling data. 
group-level search
subgroup-level search

"Error in x$lhs : $ operator is invalid for atomic vectors"

In addition to the examples in the gimme package, this error occurs when applying my own data or simulated data. My data format is the same as in the example. I ran the test on two computers, and both returned the same error.

Thanks

Katie Gates

unread,
Aug 29, 2023, 9:00:30 AM8/29/23
to gimme-r
Hey there, thanks for reaching out and providing so much information. 

This bug should be fixed in the current gimme version 07-.14. Please let me know if it persists. 

7023...@qq.com

unread,
Aug 29, 2023, 12:22:56 PM8/29/23
to gimme-r
I tried to run the gimme (version 07-.14. ) several times, using the same data and different computers, but still got the same error.

7023...@qq.com

unread,
Aug 30, 2023, 10:39:43 AM8/30/23
to gimme-r
When I used the "traceback ()"  to look at the source of the error, the  error was generated from gimme::determine.subgroups.
> traceback()
8: paste0(x$lhs, x$op, x$rhs) 7: FUN(X[[i]], ...) 6: lapply(mi_list, function(x) { x$param <- paste0(x$lhs, x$op, x$rhs) x$sig <- x$dir <- ifelse(x$mi > chisq_cutoff, 1, 0) return(x) }) 5: determine.subgroups(base_syntax = c(dat$syntax, grp$group_paths), data_list = dat$ts_list, n_subj = dat$n_subj, chisq_cutoff = dat$chisq_cutoff_mi_epc, file_order = dat$file_order, elig_paths = c(elig_paths, dat$fixed_paths), confirm_subgroup = confirm_subgroup, out_path = dat$out, sub_feature = sub_feature, sub_method = sub_method, sub_sim_thresh = sub_sim_thresh, hybrid = hybrid, dir_prop_cutoff = dir_prop_cutoff) 4: subgroupStage(dat, grp[[i]], confirm_subgroup, elig_paths, sub_feature, sub_method, ms_tol = ms_tol, ms_allow = FALSE, sub_sim_thresh = sub_sim_thresh, hybrid, dir_prop_cutoff = dir_prop_cutoff) 3: FUN(X[[i]], ...) 2: lapply(seq_along(grp), function(i) { res <- subgroupStage(dat, grp[[i]], confirm_subgroup, elig_paths, sub_feature, sub_method, ms_tol = ms_tol, ms_allow = FALSE, sub_sim_thresh = sub_sim_thresh, hybrid, dir_prop_cutoff = dir_prop_cutoff) }) 1: gimmeSEM(data = data.list, out = "H:/GIMME/newraw/FunVoluWCF/result2/Data1", ar = TRUE, plot = F, subgroup = T)

7023...@qq.com

unread,
Aug 30, 2023, 10:39:49 AM8/30/23
to gimme-r
I would like to extend my sincere appreciation for promptly addressing the bug. At present, gimme package is upgraded to version 0.7-15, and the BUG can be solved by adding the parameter " standardize=T ". 
However when setting up the parameter " standardize=F ", there are still reported errors.
在2023年8月30日星期三 UTC+8 00:22:56<7023...@qq.com> 写道:

Katie Gates

unread,
Aug 30, 2023, 10:40:55 AM8/30/23
to gimme-r
Thank you for letting us know! We had thought the fix was on the most recent CRAN version but it had only been fixed on GitHub. 

Rebecca Marks

unread,
Dec 11, 2023, 4:30:49 PM12/11/23
to gimme-r
Hi Katie,

I'm also getting "Error in x$lhs : $ operator is invalid for atomic vectors" using version 0.7-15 though it's not accompanied by a warning about variance - instead I'm getting a nonfatal modindices warning ("Error in modindices(fit, standardized = FALSE, sort. = FALSE) :  lavaan ERROR: could not compute modification indices; information matrix is singular"). I get the same error on multiple computers (all Mac) and not when using the tutorial data.

S-gimme ran without errors if I set standardize=TRUE. However, the output was notably different from the results I got with the identical data and code (with the exception of the standardize parameter) when I initially ran these analyses two years ago. I unfortunately don't have a record of which package version that was, but it was in October 2021.

Could you advise? I don't understand the theoretical motivation behind how the standardize parameter is set, so I'm not sure how to interpret the difference. I am happy to send all data, code, and a summary of how the results differ.

Thank you for your help with this!
Rebecca
Reply all
Reply to author
Forward
0 new messages