Trouble starting R-studio

Dear, I just re-installed my R and R-studio (haven't used it for awhile so deleted and reinstalled the newest versions), I am keep facing the following problems:

C:\Users\Erin\Documents>
C:\Users\Erin\Documents>install.packages("survival")
'install.packages' is not recognized as an internal or external command,
operable program or batch file.

Could you please help me with this? Thank you.

You are trying to run an R command from the Windows command line. You need to run it from within R or RStudio. You should have an icon for RStudio in the list of programs that you access through the Windows icon. Click on that and you should get the RStudio interface. You can then run install.packages() from the console page at the lower left.