install.packages("ggplot2") and install.packages("dplyr") errors

Hello. I'm very new to R and following online instructions but getting errors I do not know what to do with. Can anyone help me please?

frostrs@RogeranostsiMac ~ % install.packages("ggplot2")
zsh: missing delimiter for 'g' glob qualifier
frostrs@RogeranostsiMac ~ % install.packages("dplyr")
zsh: number expected
frostrs@RogeranostsiMac ~ %

I am not a MAC user but it looks like you are working at systems level and not in R or RStudio.

If you have RStudio installed, load it and issue the command in it. Otherwise start Rfrom the terminal and issue the command within R.

Thanks I'll give those solutions a try.