Hi, I am trying to put this into R, but it keeps telling me I have an "unexpected symbol". it works on other computers, I'm not sure why it won't work on mine. I am using a mac.
My hunch is that you are copying and pasting in the R console. You should create an R script (File > New File > R script) and paste the code in the script instead and run it from there (Ctrl + Enter). Try it and let me know please.
No, I am pasting it into a new R Script. The error message is appearing in the console. Ive tried everything I can think of. Thank you so much for all of your help!
Will you please take a full screen capture of the code pasted in RStudio? Not only a section of it but both the R script and the console and the error.
That error is happening because for some reason when you paste the code, spaces are getting trimmed, this part is getting pasted together length(control)control.scaled but should be separated length(control) control.scaled
Try to reformat respecting newlines and spaces, like this
THANK YOU! Sorry, I am VERY new to R. I took this class to fulfill my stats requirement and I am a history major. Not really my forte. Youre a LIFE SAVER! thank you!
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: