STAT 353 Tutorial 1.pdf - STAT 353 Tutorial 1 Start up...

This preview shows page 1 - 2 out of 4 pages.

1 STAT 353 Tutorial 1 Start up RStudio. You will notice immediately the R console. This is where you will write your programs. If at anytime you want to learn more about R, the webpage is located at: , this is also where R can be downloaded from for free! You can get to it from the Help menu -> R Help. If you want further instruction such as a more intensive tutorial go to the Help menu-> An Introduction to R . To keep track of your code, you can start a script. A script is a simple text editor that you can open using File menu -> New file -> R script. You can use another text editor if you would like, and run your code by copying and pasting it in. For example, Microsoft Word will allow you to copy and paste graphs directly from R. Type in the bold font in into your R console to explore what happens. 1. Getting help The most important command is help: help() help(matrix) This is helpful only if you already know the name of the function you want help on. You can also start a webpage with a search engine. help.start() 2. Arithmetic Basic arithmetic can be used in R using the following symbols: +, -, /, *, ^ or ** (exponents). 2*2^2 3. Creating Vectors You can create a vector with the " c " command: a <- c(1,2,3,5) b = c('red','blue','green') The " c " command produces a vector, and the " <- " or “=”command assigns it to the object a . You can print out an object by typing its name: a
Image of page 1

Subscribe to view the full document.

2 ALL R objects are stored as files on disk. They will not be deleted at the end of a session.
Image of page 2
You've reached the end of this preview.
  • Fall '15

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern