How can data be merged in the jamovi?

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
DeborahA
Posts: 22
Joined: Tue Apr 14, 2020 11:38 am

Re: How can data be merged in the jamovi?

Post by DeborahA »

I had a student ask about this today so just wanted to add an upvote for this feature - currently I do this via a custom R script.

Best

Deborah.
antara
Posts: 4
Joined: Wed Jan 27, 2021 4:45 am

Re: How can data be merged in the jamovi?

Post by antara »

Is there any new resolution to this query either on jamovi or via R ?

I want to add my vote to this feature. I am working on a trajectory panel, and would need to merge data by variable several times.

I found Jamovi today and it looks like a brilliant tool to manage, manipulate, analyze data all in the same place in a simple manner, while learning R script and allowing me the flexibility to use R script. Thank you for your good work.
antara
Posts: 4
Joined: Wed Jan 27, 2021 4:45 am

Re: How can data be merged in the jamovi?

Post by antara »

DeborahA wrote:I had a student ask about this today so just wanted to add an upvote for this feature - currently I do this via a custom R script.

Best

Deborah.
Hello Deborah, could I request you to share the custom script ? I am learning my way in and it would help me write it for my data.
DeborahA
Posts: 22
Joined: Tue Apr 14, 2020 11:38 am

Re: How can data be merged in the jamovi?

Post by DeborahA »

Hi Jonathan,

I just wanted to add another vote for this feature! In SPSS you can merge files by either adding cases or adding variables: https://www.ibm.com/docs/en/spss-statis ... erge-files - this would be like adding variables. It's very common, for instance when doing experiments online and combining a number of different tasks, to need to merge different files together by participant code. I've been doing this in R, but we have an increasing number of students at our university using jamovi, and it would be great to have this feature.

Thanks!

Deborah.
DeborahA
Posts: 22
Joined: Tue Apr 14, 2020 11:38 am

Re: How can data be merged in the jamovi?

Post by DeborahA »

I am so sorry I never saw this request! Here's my code:

Code: Select all

# Note: You may have to install these packages if you don't have them.

library(readr) # for reading in csv files 
library(haven) # for SPSS data
library(dplyr) # for wrangling data
library(here)  # for simplifying file paths
library(tidyverse) # for making everything tidy

# read in data - replace with your folder and file names as needed, or just rename your files. 

Inquisit_Data <- read_csv(here("Inquisit_folder","InquisitData.csv")) # Read in Inquisit file
Qualtrics_Data <- read_sav(here("Qualtrics_folder", "QualtricsData.sav")) # Read in Qualtrics file saved as SPSS .sav file

# check whether your Qualtrics person has completed the Inquisit task. 
# You may need to replace the variable names with whatever they are in your data. 
# In my data they were called ResponseID and subjectid

# Merge the data by participant IDs. 

Qualtrics_Inquisit <- merge(x = Qualtrics_Data, y = Inquisit_Data, 
                            by.x = "ResponseId", by.y = "script.subjectid", all.x = TRUE)


# Write main data to file (both .sav and .csv format)
write.csv(Qualtrics_Inquisit, file = "Qualtrics_Inquisit.csv") 
write_sav(Qualtrics_Inquisit, "Qualtrics_Inquisit.sav")


antara wrote:
DeborahA wrote:I had a student ask about this today so just wanted to add an upvote for this feature - currently I do this via a custom R script.

Best

Deborah.
Hello Deborah, could I request you to share the custom script ? I am learning my way in and it would help me write it for my data.
Post Reply