Tuesday, 10 September 2013

How to return a specific value from a CSV file in R

How to return a specific value from a CSV file in R

I have a CSV file of all symbols listed on the NYSE, it is formated as
follows:
Symbol Name Last Sale
1 DDD Company_name1 val_1
2 SSYS Stratasys val_2
3 GOOG Google val_3
4 GS Goldman Sachs val_4
5 AAPL Apple val_5
This is how it is displayed after importing my CSV file
companylist <- read.csv("~/Downloads/companylist.csv")
View(companylist)
How would I go about retrieving company's specific symbol? For example if
I wanted to get the symbol for the 2nd to last stock, what code should I
use? I have been searching for an answer for the past 6 hours and have
looked at the documentation but cant seem to find anything relevant.

No comments:

Post a Comment