[R] Importing Excel/Openoffice Dates into R

Ashley Davies adavies at ideaglobal.com
Fri Jan 2 09:29:15 CET 2004


I would like to import some daily financial data from excel via csv. 
More specifically, I would like to be able to use the ts.union function 
from the tseries library as the dates are irregular and I need to line 
up the dates so that I can place all the variables into one data frame.

The trouble is, how do I import the dates from excel into R? At the 
moment I'm just importing the data via read.csv, but I don't know how to 
bring the dates in as well.

Example: Here are two csv files.  The first file is missing Jan 13th and 
  the second is missing the 8th.

file 1: cboevix.csv
1/1/1999	24.42
1/4/1999	26.17
1/5/1999	24.46
1/6/1999	23.34
1/7/1999	24.37
1/8/1999	23.28
1/11/1999	25.46
1/12/1999	28.1
1/14/1999	32.98

file 2: yenv.csv

1/1/1999	19.5
1/4/1999	22.2
1/5/1999	23.2
1/6/1999	21
1/7/1999	20.2
1/11/1999	21.6
1/12/1999	20.9
1/13/1999	19.1
1/14/1999	19.3

# Read the files in via read.csv

#define variables

#apply dates from original csv files to the variables.
#the dates are stilling sitting in A$V1 and B$V1
#how do I apply them to VIX and YENV?

#use ts.union function to line up the dates and create data frame 
#"vixyen" with lined up data


Can anyone help me fill in those missing steps?  Thanks very much!


Ashley Davies
Economist- Australia and New Zealand
IDEAglobal - Singapore
Tel: 65- 6332-0759
Fax: 65- 6332-0701
adavies at ideaglobal.com

More information about the R-help mailing list