Rcloud:
> y <- c(8,7,7,2,4,7,4,5,3,4,7,10,6,6,5,8,5,8,7,4,2,7,5,7,8,4,6,7,9,8,6,4,2,1,4,3,5,2,5,5)
> a <- factor(rep(c("Drug A","Drug B","Drug C","Drug D"), each=10))
> dat <- data.frame(x=a, y=y)
> fit<−lm(y~a-1, data=dat)
Error: unexpected input in "fit<−"
But the same code works in Rstudio:
What is going on??
CodePudding user response:
The -
in your fit statement is a different character. RStudio complains about this if I copy your text, but still interprets it as <-
. I guess Rcloud is less forgiving.