Getting error messages when I try to execute commands.

What commands are you trying and what are the error messages? Please give as much detail as possible.

install.packages(“ggplot2”)
Error: unexpected input in "install.packages(“"

There is no run button, either.

The problem with the install.packages() function is that you have curly quotes around ggplot. Compare this correct version

install.packages("ggplot2")

with your version

install.packages(“ggplot2”)

I do not know how to get curly quotes in RStudio other than paste text in from another program. Is that what you are doing?

As for the lack of a Run button, it might be that you are running code in the Console, which directly runs each line of code without the use of a Run button. If you select the menu File -> New -> R Script, do you then see the Source pane with its Run button?

Yes, I was copying and pasting.
Yes, I did see the source pane with the Run Button when I did File->new->R Script.
I typed in the command and got the message:A version of this package for your version of R might be available elsewhere,
see the ideas at
R Installation and Administration.
I'm am so completely new at this that I didn't understand anything from the reference website.

I guess your version of R is not compatible with the version of ggplot2 that install.packages() is finding. If you run the function sessionInfo(), it will list your version of R and some other information. When I run it, the beginning of the returned information looks like this:

sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

You can see that I am running R version 4.2.1. What version are you running?

I have the same version: 4.2.1

I found my problem!! I misspelled the package name.

Thank you so very much for your help! I didn't think I was going to be able to complete this certification.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.