Displaying Data
The easiest way to display your data is to simply type the name of the variable itself. However, depending on the size of your data frame, this could get huge.
- In order to display your data, read your data into R by typing: data<-read.csv("http://joeystanley.com/downloads/menu.csv")
- Then type data into the console and click Run.
- The following should then come up in your console if you use this example. There are more lines than are shown here that you should see in your console.
- If you want to view your data like you would in a normal spreadsheet make menu a variable by typing: menu<-read.csv("http://joeystanley.com/downloads/menu.csv")
- Then, type View(menu)
- Make sure to run each line.
- You will then be able to view your data on the top left of R-Studio under menu.
- You can also just display portions of your data using head and tail, which, respectively, show the first and last couple of rows.
- To see the first couple of rows type head(menu) as shown below.
- You should then see the following in the console.
- To see the last couple of rows type tail(menu) as shown below.
- You should then see the following in the console.