Giter Site home page Giter Site logo

Comments (7)

jacob-long avatar jacob-long commented on June 12, 2024

Hmm, this is strange. Can you show me the output when you run sessionInfo()?

from interactions.

pettitta avatar pettitta commented on June 12, 2024

Sure! Here it is

R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] interactions_1.0.0 lmerTest_3.0-1 lme4_1.1-21 Matrix_1.2-10

loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 pillar_1.2.3 compiler_3.4.1 nloptr_1.0.4 plyr_1.8.4
[6] bindr_0.1.1 tools_3.4.1 boot_1.3-19 tibble_1.4.2 nlme_3.1-131
[11] gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.1 rlang_0.2.1 cli_1.0.0
[16] rstudioapi_0.7 yaml_2.1.19 bindrcpp_0.2.2 dplyr_0.7.6 knitr_1.20
[21] jtools_2.0.0 grid_3.4.1 tidyselect_0.2.4 glue_1.2.0 R6_2.2.2
[26] minqa_1.2.4 ggplot2_3.0.0 purrr_0.2.5 magrittr_1.5 scales_0.5.0
[31] MASS_7.3-47 splines_3.4.1 assertthat_0.2.0 colorspace_1.3-2 numDeriv_2016.8-1
[36] lazyeval_0.2.1 munsell_0.5.0 crayon_1.3.4

from interactions.

pettitta avatar pettitta commented on June 12, 2024

Edit: nvm. I just had to update R and it fixed the problem

from interactions.

xiaoxuefu avatar xiaoxuefu commented on June 12, 2024

Hi,

I had the same error message with interact_plot. So I stumbled upon this post. I am using the updated R version.

I tried to use the same codes as pettitta:

library(interactions)
library(jtools)

fitiris <- lm(Petal.Length ~ Petal.Width * Species, data = iris)
summ(fitiris)

interact_plot(fitiris, pred = Petal.Width, modx = Species, plot.points = TRUE)

I got: Error: expr must quote a symbol, scalar, or call

Here is my traceback() outputs

8: stop(cnd)
7: abort("expr must quote a symbol, scalar, or call")
6: switch_type(expr, symbol = as_string(expr), quosure = , language = {
name <- deparse_one(expr)
name <- gsub("\n.$", "...", name)
name
}, if (is_scalar_atomic(expr)) {
as.character(expr)
} else if (length(expr) == 1) {
name <- expr_text(expr)
name <- gsub("\n.
$", "...", name)
name
} else {
abort("expr must quote a symbol, scalar, or call")
})
5: expr_name(quo_squash(quo))
4: quo_name(enexpr(mod2))
3: (function (model, pred, modx, modx.values = NULL, mod2 = NULL,
mod2.values = NULL, centered = "all", data = NULL, plot.points = FALSE,
interval = FALSE, int.type = c("confidence", "prediction"),
int.width = 0.95, outcome.scale = "response", linearity.check = FALSE,
facet.modx = FALSE, robust = FALSE, cluster = NULL, vcov = NULL,
set.offset = 1, x.label = NULL, y.label = NULL, pred.labels = NULL,
modx.labels = NULL, mod2.labels = NULL, main.title = NULL,
legend.main = NULL, colors = NULL, line.thickness = 1, vary.lty = TRUE,
point.size = 1.5, point.shape = FALSE, jitter = 0, rug = FALSE,
rug.sides = "b", partial.residuals = FALSE, point.alpha = 0.6,
color.class = NULL, ...)
{
dots <- list(...)
if (length(dots) > 0) {
if ("modxvals" %in% names(dots)) {
modx.values <- dots$modxvals
}
if ("mod2vals" %in% names(dots)) {
mod2.values <- dots$mod2vals
}
}
if (!is.null(color.class)) {
colors <- color.class
msg_wrap("The color.class argument is deprecated. Please use 'colors'\n instead.")
}
pred <- quo_name(enexpr(pred))
modx <- quo_name(enexpr(modx))
if (modx == "NULL") {
modx <- NULL
}
mod2 <- quo_name(enexpr(mod2))
if (mod2 == "NULL") {
mod2 <- NULL
}
if (any(c(pred, modx, mod2) %in% centered)) {
warn_wrap("You cannot mean-center the focal predictor or moderators with\n this function.")
centered <- centered %not% c(pred, modx, mod2)
if (length(centered) == 0) {
centered <- "none"
}
}
modxvals2 <- mod2vals2 <- resp <- NULL
if (linearity.check == TRUE) {
facet.modx <- TRUE
}
if (is.null(data)) {
d <- get_data(model, warn = TRUE)
}
else {
d <- data
}
weights <- get_weights(model, d)$weights_name
pred_out <- prep_data(model = model, pred = pred, modx = modx,
modx.values = modx.values, mod2 = mod2, mod2.values = mod2.values,
centered = centered, interval = interval, int.type = int.type,
int.width = int.width, outcome.scale = outcome.scale,
linearity.check = linearity.check, robust = robust, cluster = cluster,
vcov = vcov, set.offset = set.offset, modx.labels = modx.labels,
mod2.labels = mod2.labels, facet.modx = facet.modx, d = d,
survey = "svyglm" %in% class(model), weights = weights,
preds.per.level = 100, partial.residuals = partial.residuals,
...)
meta <- attributes(pred_out)
lapply(names(meta), function(x, env) {
env[[x]] <- meta[[x]]
}, env = environment())
pm <- pred_out$predicted
d <- pred_out$original
if (!is.numeric(d[[pred]])) {
stop("Focal predictor ("pred") cannot be a factor. Either",
" use it as modx, convert it to a numeric dummy variable,",
" or use the cat_plot function for factor by factor interaction",
" plots.")
}
plot_mod_continuous(predictions = pm, pred = pred, modx = modx,
resp = resp, mod2 = mod2, data = d, plot.points = plot.points |
partial.residuals, interval = interval, linearity.check = linearity.check,
x.label = x.label, y.label = y.label, pred.labels = pred.labels,
modx.labels = modx.labels, mod2.labels = mod2.labels,
main.title = main.title, legend.main = legend.main, colors = colors,
line.thickness = line.thickness, vary.lty = vary.lty,
jitter = jitter, modxvals2 = modxvals2, mod2vals2 = mod2vals2,
weights = weights, rug = rug, rug.sides = rug.sides,
point.size = point.size, point.shape = point.shape, facet.modx = facet.modx)
})(model = fitiris, pred = Petal.Width, modx = Species, plot.points = TRUE)
2: do.call(get("interact_plot", asNamespace("interactions")), as.list(match.call(get("interact_plot",
asNamespace("interactions"))))[-1])
1: interact_plot(fitiris, pred = Petal.Width, modx = Species, plot.points = TRUE)

My sessionInfo():

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] jtools_2.0.0 interactions_1.1.0.9000

loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 rstudioapi_0.7 bindr_0.1.1 magrittr_1.5 tidyselect_0.2.4 munsell_0.5.0
[7] colorspace_1.3-2 R6_2.2.2 rlang_0.2.1 plyr_1.8.4 dplyr_0.7.6 tools_3.5.2
[13] grid_3.5.2 gtable_0.2.0 cli_1.0.0 yaml_2.1.19 lazyeval_0.2.1 assertthat_0.2.0
[19] tibble_1.4.2 crayon_1.3.4 bindrcpp_0.2.2 purrr_0.2.5 ggplot2_3.0.0 glue_1.3.0
[25] compiler_3.5.2 pillar_1.3.0 scales_0.5.0 pkgconfig_2.0.1

Thank you very much for your help!

from interactions.

jacob-long avatar jacob-long commented on June 12, 2024

Hi @xiaoxuefu, thank you for sharing your sessionInfo().

Can you try updating the rlang package (update.packages("rlang")) and see if that changes anything?

from interactions.

xiaoxuefu avatar xiaoxuefu commented on June 12, 2024

@jacob-long Thank you so much! It solved the problem.

Great package!

from interactions.

jacob-long avatar jacob-long commented on June 12, 2024

Great news! Now I can change a setting to make sure everybody who installs this package has an up-to-date version of rlang.

from interactions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.