unable to import data

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)
Post Reply
sabo
Posts: 2
Joined: Thu Dec 03, 2020 3:12 pm

unable to import data

Post by sabo »

Hi there!

as part of a larger project, I used Rstudio to prepare data files and merged them. I then exported the new dataframe, using the following functions:

Code: Select all

#### export of finaler Datensatz to csv ####
write.table(dat, file="dat_HH1_Skalen.csv", sep= ";", dec = ",", col.names  = NA, fileEncoding = "UTF-8") 

####save RData-file ####
save(dat, file = "dat_HH1_Skalen.Rdata")

#### export of data.frame to sav ####
write_sav(dat, "dat_HH1_Skalen.sav")
Now, if I try to import the SPSS and Rdata file into Jamovi, I get the following error message:
unable to convert string to the requested encoding (invalid byte sequence)
I know it has something to do with encoding but I am not sure how to fix it. Does anyone have a similar problem and could fix it?

Thanks in advance!

Cheers,

sabo
sabo
Posts: 2
Joined: Thu Dec 03, 2020 3:12 pm

Re: unable to import data

Post by sabo »

Short update:

When I open the SPSS-file, I created with RStudio and save it again as "SPSS Statistics Local Coding (*.sav)", I can open it with Jamovi.

But I still wonder if there is a way to export the dataframe in RStudio without having to use SPSS in order to open it in Jamovi.

Thanks!
sbalci
Posts: 124
Joined: Sat Jan 06, 2018 10:25 pm
Contact:

Re: unable to import data

Post by sbalci »

Hi,
You may try saveRDS to save .RDS file then import it to jamovi.
There is also a package:
https://cran.r-project.org/web/packages/jmvReadWrite/index.html
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: unable to import data

Post by jonathon »

if you can provide all these different files (either attach here, or send it to contact <at> jamovi.org), then i'll take a look (actually, your best bet would be to create an issue on our github page, that way it won't get forgotten). it looks like there's a corrupt string somewhere in the file (a sequence of bytes considered illegal by UTF-8). that's the issue, but we should handle it better than we do.

cheers

jonathon
ricslator
Posts: 1
Joined: Mon May 10, 2021 6:04 am

Re: unable to import data

Post by ricslator »

Simplest of all Solutions:

import pandas as pd
df = pd.read_csv('file_name.csv', engine='python')

http://net-informations.com/ds/pda/csv.htm
Post Reply