scatr

Everything related to development of the jamovi platform
Post Reply
decaux
Posts: 27
Joined: Wed Feb 19, 2020 1:35 pm

scatr

Post by decaux »

Hello, I posted this at https://github.com/jamovi/scatr/issues/2 about a week ago.

I wanted to use scatr in R to get a scatterplot, but I get errors
Here is the code with # errors
data <- data.frame(Age = runif(100, 25, 90))
a <- 0
b <- sample(c(-1, 1), 1) * sample(c(0.2, 0.4, 0.6), 1)
data$Score <- a + b * data$Age + rnorm(100, sd = 15)

#from syntax mode in jamovi

scatr::scat(
data = data,
x = Age,
y = Score)

#Error in initialize(...) : object 'Age' not found

# so specified variables with $
scatr::scat(
data = data,
x = data$Age,
y = data$Score)

#Error in .subset2(x, i, exact = exact) : subscript out of bounds
############################
It works fine in Rj Editor in jamovi but not in R.
Appreciate your help
Best, Peter
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: scatr

Post by MAgojam »

Hey Peter,

you have a clean installation from

Code: Select all

install_github("raviselker/scatr")
are jmvcore and jmvconnect also installed?

I have another experience with your data (WIN10 PRO, R 4.1.3, R 4.2.2).
scatr_R4.1.3.png
scatr_R4.1.3.png (108.86 KiB) Viewed 4707 times
scatr_R4.2.2.png
scatr_R4.2.2.png (109.03 KiB) Viewed 4707 times
Best, Maurizio
decaux
Posts: 27
Joined: Wed Feb 19, 2020 1:35 pm

Re: scatr

Post by decaux »

That fixed it, many thanks Maurizio
Post Reply