Page 1 of 1

scatr

Posted: Thu Nov 03, 2022 12:09 pm
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

Re: scatr

Posted: Thu Nov 03, 2022 6:54 pm
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 9411 times
scatr_R4.2.2.png
scatr_R4.2.2.png (109.03 KiB) Viewed 9411 times
Best, Maurizio

Re: scatr

Posted: Fri Nov 04, 2022 6:51 am
by decaux
That fixed it, many thanks Maurizio