Page 1 of 1

Computing new variable with Rj editor and seeing it in the spreadsheet

Posted: Sat Jul 27, 2024 10:12 am
by Cristóbal Lozano
Hi there!

I am trying to compute a new variable 'combo', which is a combination of two existing variables (Participant, ID).

I can do this easily with the Compute menu with a formula (= Participant + "-" + ID) and it works perfectly. I can see the new variable 'combo' in the Jamovi spreadsheet.

Imagine now I want to do the same but this time using the Rj editor. I can calculate a new variable 'combo2' with the 'paste' function:

Code: Select all

data$combo2 <- paste(data$Participant, data$ID, sep = "-")
I can see that the newly computed variable 'combo2' has been created when I ask for a summary of the variable:

Code: Select all

summary(data$combo2)
Length Class Mode
7319 character character


The problem is that the new computed variable 'combo2' does not show up in the Jamovi spreadsheet!! I have tried several things to see 'combo2' in the spreadsheet but Jamovi always reports an errror. I have tried these lines of code (one at a time) but I get an error message of the type 'update is not an exported object from namespace:jmv' or 'fromDataFrame is not an exported object from namespace:jmv' and similar.

Code: Select all

jmv::update(data)

Code: Select all

jmv::fromDataFrame(data)   

Code: Select all

jmvcore::toDataFrame(data)  

Code: Select all

jmvcore::setData(data)
The problem (not visualising in the spreadsheet a newly computed variable via Rj editor) seems silly but I cannot figure out how to solve it. Please help!! Thanks. Cristóbal

Re: Computing new variable with Rj editor and seeing it in the spreadsheet

Posted: Sat Jul 27, 2024 1:26 pm
by reason180
You need to opt to use Rj+ (within Rj). Then you need to select the Participant and ID variables (using the gui). Then run your R code.

Re: Computing new variable with Rj editor and seeing it in the spreadsheet

Posted: Sat Jul 27, 2024 1:38 pm
by Cristóbal Lozano
It works now!!
Thank you so much, reason180.
I can see now that one of the differences between the Rj Editor and the Rj Editor+ is that in the latter you need to move the variables to the right in the GUI for them to be considered by the function at hand, right?

Re: Computing new variable with Rj editor and seeing it in the spreadsheet

Posted: Sat Jul 27, 2024 1:49 pm
by reason180
Yes, that's correct.