Skip to content

[Bug]: R Syntax doesn't work #2990

@LarsdeVreugd

Description

@LarsdeVreugd

JASP Version

0.19.1

Commit ID

No response

JASP Module

Regression

What analysis are you seeing the problem on?

Linear Regression

What OS are you seeing the problem on?

macOS Silicon

Bug Description

I encountered this issue in my own analysis, made a mock data-set to show the error.
The issue is about the R Syntax:

Step 1: mock data-set
Step1

Step 2: Made a linear regression model of B and C on A
Step2

Step 3: Made a new regression model
Step3

Step 4: Copied R Syntax from the first regression model
Step4

Step 5: When I paste the syntax in the new model, it gives an error (see screenshot). The error also occurs when I type the R syntax instead of
Step5
copying it.

Expected Behaviour

The syntax function is great and would be nice if it works :)

Steps to Reproduce

See pictures

Log (if any)

Evaluating R-code:
options(renv.config.install.verbose=FALSE)
Output:

00:00:00.000: Received: '{
"moduleCode" : ".libPaths(c('/Applications/JASP.app/Contents/MacOS/../Frameworks/R.framework/Versions/4.4-arm64/Resources/library', '/Applications/JASP.app/Contents/Modules/jaspRegression'));\n library('jaspRegression');\nreturn('succes!')",
"moduleName" : "jaspRegression",
"moduleRequest" : "loading",
"typeRequest" : "moduleLoadRequest"
}
' so now clearing my send buffer
00:00:00.001: Engine received moduleLoadRequest message
00:00:00.002: About to run module request for module 'jaspRegression' and code to run:
'.libPaths(c('/Applications/JASP.app/Contents/MacOS/../Frameworks/R.framework/Versions/4.4-arm64/Resources/library', '/Applications/JASP.app/Contents/Modules/jaspRegression'));
library('jaspRegression');
return('succes!')'
jaspRCPP_evalRCode runs:
".libPaths(c('/Applications/JASP.app/Contents/MacOS/../Frameworks/R.framework/Versions/4.4-arm64/Resources/library', '/Applications/JASP.app/Contents/Modules/jaspRegression'));
library('jaspRegression');
return('succes!')"
Evaluating R-code:
returnVal = 'null'; tryCatch( suppressWarnings({ returnVal <- eval(parse(text=.rCode)) }), error = function(e) { .setRError( paste0(toString(e$message), '
', paste0(sys.calls()[sys.nframe():2], collapse='
'))) } ); returnVal
Output:

00:00:00.069: Was succesful, now crafting answer.
00:00:00.069: Sending it.
00:00:00.174: Received: '{
"rCode" : "jaspRegression::RegressionLinear(\n version = "0.19",\n formula = VariableA ~ VariableB + VariableC,\n covariates = list("VariableB", "VariableC"),\n weights = list(types = list(), value = ""))",
"requestId" : 2,
"returnLog" : false,
"typeRequest" : "rCode",
"whiteListed" : false
}
' so now clearing my send buffer
00:00:00.175: Engine received rCode message
jaspRCPP_evalRCode runs:
"jaspRegression::RegressionLinear(
version = "0.19",
formula = VariableA ~ VariableB + VariableC,
covariates = list("VariableB", "VariableC"),
weights = list(types = list(), value = ""))"
Evaluating R-code:
returnVal = 'null'; tryCatch( suppressWarnings({ returnVal <- eval(parse(text=.rCode)) }), error = function(e) { .setRError( paste0(toString(e$message), '
', paste0(sys.calls()[sys.nframe():2], collapse='
'))) } ); returnVal
Output:
00:00:00.188: DataSet::DataSet(index=1)

00:00:00.195: R Code yielded error

More Debug Information

-------- Application Info --------
JASP Version: JASP 0.19.1 (Apple Silicon)
Build Branch: development
Build Date: Sep 9 2024 13:50:55 (Netherlands)
Last Commit: 28c9e9916b15ff84dfb998ad5db78a421b985aa0

-------- Basic Info --------
Operating System: macOS 14.6
Product Version: 14.6
Kernel Type: darwin
Kernel Version: 23.6.0
Architecture: arm64
Install Path: /Applications/JASP.app/Contents/MacOS
Platfotm Name: cocoa (<There's a typo here)
System Local: en_NL

Final Checklist

  • I have included a screenshot showcasing the issue, if possible.
  • I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • I have accurately described the bug, and steps to reproduce it.

Metadata

Metadata

Labels

Bug: HighBugs that are negatively affecting the area of the program, but don't need immediate fix.Module: jaspRegression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions