Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depends on R 4.x? #3

Closed
PaulCristina opened this issue Dec 21, 2022 · 1 comment
Closed

Depends on R 4.x? #3

PaulCristina opened this issue Dec 21, 2022 · 1 comment

Comments

@PaulCristina
Copy link

I'm trying to run the below example and having an error.

Using R 3.6 and library version 'MKinfer_0.9'

`set.seed(13)
x <- rnorm(100)
g <- factor(sample(1:2, 100, replace = TRUE))
levels(g) <- c("a", "b")
MKinfer::pairwise.ext.t.test(x, g, method = "perm.t.test")

Error in deparse1(substitute(x)): could not find function "deparse1"
Traceback:

  1. pairwise.ext.t.test(x, g, method = "perm.t.test")
  2. paste(deparse1(substitute(x)), "and", deparse1(substitute(g)))`

`R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] bestNormalize_1.8.2 MKinfer_0.9 pwr_1.3-0
[4] grizbayr_1.3.1 powerMediation_0.3.4 bayestestR_0.11.5
[7] BayesFactor_0.9.12-4.3 Matrix_1.2-17 coda_0.19-4
[10] scales_1.2.1 IRdisplay_1.1 knitr_1.40
[13] kableExtra_1.3.4 formattable_0.2.1 report_0.5.1
[16] formatR_1.12 dobin_1.0.2 EnvStats_2.7.0
[19] outliers_0.15 skimr_2.1.3 DataExplorer_0.8.2
[22] dataiku_11.0.0 lubridate_1.8.0 ggplot2_3.3.6
[25] data.table_1.14.2 dplyr_1.0.9 tictoc_1.0.1
[28] glue_1.6.2

loaded via a namespace (and not attached):
[1] colorspace_2.0-3 class_7.3-15 base64enc_0.1-3
[4] fs_1.5.2 rstudioapi_0.14 listenv_0.8.0
[7] MatrixModels_0.5-0 prodlim_2019.11.13 fansi_1.0.3
[10] mvtnorm_1.1-3 MKdescr_0.7 xml2_1.3.3
[13] codetools_0.2-16 splines_3.6.0 doParallel_1.0.17
[16] IRkernel_1.3 jsonlite_1.8.0 compiler_3.6.0
[19] httr_1.4.4 assertthat_0.2.1 fastmap_1.1.0
[22] cli_3.3.0 htmltools_0.5.3 tools_3.6.0
[25] gmp_0.6-5 igraph_1.3.0 gtable_0.3.0
[28] doRNG_1.8.2 Rcpp_1.0.8.3 vctrs_0.4.1
[31] RJSONIO_1.3-1.6 arrangements_1.1.9 svglite_2.1.0
[34] nlme_3.1-139 iterators_1.0.14 exactRankTests_0.8-35
[37] insight_0.17.0 timeDate_3043.102 xfun_0.32
[40] gower_1.0.0 stringr_1.4.1 globals_0.16.0
[43] networkD3_0.4 rvest_1.0.2 lifecycle_1.0.1
[46] rngtools_1.5.2 gtools_3.9.3 future_1.24.0
[49] MASS_7.3-51.4 ipred_0.9-12 parallel_3.6.0
[52] pbapply_1.5-0 gridExtra_2.3 rpart_4.1-15
[55] stringi_1.7.8 foreach_1.5.2 butcher_0.1.5
[58] hardhat_0.2.0 boot_1.3-22 lava_1.6.10
[61] repr_1.1.4 rlang_1.0.4 pkgconfig_2.0.3
[64] systemfonts_1.0.4 evaluate_0.16 lattice_0.20-38
[67] purrr_0.3.4 recipes_0.2.0 htmlwidgets_1.5.4
[70] tidyselect_1.1.2 parallelly_1.30.0 magrittr_2.0.3
[73] R6_2.5.1 generics_0.1.3 pbdZMQ_0.3-7
[76] DBI_1.1.3 pillar_1.8.1 withr_2.5.0
[79] nnet_7.3-12 survival_2.44-1.1 datawizard_0.4.0
[82] future.apply_1.8.1 tibble_3.1.8 crayon_1.5.1
[85] uuid_1.1-0 utf8_1.2.2 rmarkdown_2.16
[88] usethis_2.1.5 grid_3.6.0 digest_0.6.29
[91] webshot_0.5.2 tidyr_1.2.0 munsell_0.5.0
[94] viridisLite_0.4.1 `

@stamats
Copy link
Owner

stamats commented Dec 21, 2022

yes, you are right!
I use function deparse1 in function pairwise.ext.t.test, which was added in R 4.0.0.
I have updated the dependency from R 3.5.0 to R 4.0.0.
If you would replace line 3:

DNAME <- paste(deparse1(substitute(x)), "and", deparse1(substitute(g)))

by

DNAME <- paste(deparse(substitute(x)), "and", deparse(substitute(g)))

the function should also work in R 3.6.0. I decided not to change my function, since function deparse1 was introduced exactly for that purpose

"deparse1() is a simple utility added in R 4.0.0 to ensure a string result (character vector of length one), typically used in name construction, as deparse1(substitute)(.))."

I have now also adapted other functions of package MKinfer that still used deparse instead of deparse1.

I hope that you can update R, since version 3.6.0 is really quite old (in R terms).

Best
Matthias

@stamats stamats closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants