Hello, I am relatively new to using R. I am using R version 2.8.0. I have a
program that downloads stock data from Yahoo! Finance and stores it to a
text file on my hard drive. The text file contains the date, opening price,
high price, low price, closing price, volume and adjusted price (i.e.,
adjusted for dividends and splits). I want to read and manipulate the data
in R. However, when I use read.table, it treats all of the data as
"factors" and I do not know how to treat the data as numbers:
Warning message:
In Ops.factor(spy[1, 5], spy[1, 2]) : - not meaningful for factors
As you can see, I cannot calculate the difference between the closing price
and the opening price, (much less compute averages, etc). This is clearly a
"newbie" problem. In my defense, I am using the book by Michael Crawley
(The R Book) as my teaching guide, but I cannot find the answer to this
question in that rather densely packed book.
Any help is appreciated.