I'm trying to do an analysis of the BTC price here in Brazil, and compare it with other 4 countries..
So I've found quandl and downloaded their .csv data for both countries.
Each .csv has 6 columns:
- Date
- 24h.Average
- Ask
- Bid
- Last
- Total.Volume
Well, I'm trying to make a new table with:
BTCBRL$Date
BTCBRL$Last
BTCUSD$Last
BTCCNY$Last
BTCEUR$Last
So I wrote:
lastPrices <- cbind(BTCBRL$Date, BTCBRL$Last, BTCUSD$Last, BTCCNY$Last, BTCEUR$Last)
But then my date that once was 2015-07-05
, just became 656
..
What's an efficient to deal with it? Preferably overwriting it in the same table..
Use data.frame()
rather than cbind()
if you want to preserve mixed types (ie have both dates and numeric values). The latter returns a matrix and a matrix can only hold a single atomic data type so it converts everything to numeric.