read.yearmon: Reading Monthly zoo Series

Description Usage Arguments Details Value See Also Examples

View source: R/read.yearmon.R

Description

Read a text file containing monthly data with a date column and return a zoo object with index = a yearmon series with the dates read as names.

Usage

1
2
read.yearmon(file, format = "", tz = "", FUN = NULL, regular = FALSE,
             index.column = 1, ...)

Arguments

As for read.zoo:

file

character giving the name of the file which the data are to be read from/written to. See read.table and write.table for more information.

format

date format argument passed to as.Date.character.

tz

time zone argument passed to as.POSIXct.

FUN

a function for computing the index from the first column of the data. See details.

regular

logical. Should the series be coerced to class "zooreg" (if the series is regular)?

index.column

integer. The column of the data frame in which the index/time is stored.

...

further arguments passed to read.table or write.table, respectively.

Details

TS <- read.zoo(...) zoo(coredata(TS), as.yearmon2(index(TS)))

Value

an object of class "zoo" (or "zooreg").

See Also

read.table zoo read.zoo coredata index as.yearmon2

Examples

1
2
3
4
5
6
7
8
## Not run: 
## turn *numeric* first column into yearmon index
## where number is year + fraction of year represented by month
z <- read.zoo("foo.csv", sep = ",", FUN = as.yearmon2)
z2 <- read.yearmon("foo.csv", sep = ",")


## End(Not run)

FinTS documentation built on May 29, 2017, 9:08 a.m.