need data to reproduce

On Mon, May 27, 2013 at 6:00 AM, <r-sig-finance-request@r-project.org>wrote:

> Send R-SIG-Finance mailing list submissions to
>         r-sig-finance@r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> or, via email, send a message with subject or body 'help' to
>         r-sig-finance-request@r-project.org
>
> You can reach the person managing the list at
>         r-sig-finance-owner@r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-SIG-Finance digest..."
>
>
> Today's Topics:
>
>    1. Extracting numeric data from a mixed data .csv file (dae)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 26 May 2013 14:53:49 -0700 (PDT)
> From: dae <dougedmunds@gmail.com>
> To: r-sig-finance@r-project.org
> Subject: [R-SIG-Finance] Extracting numeric data from a mixed data
>         .csv file
> Message-ID: <1369605229575-4668030.post@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> I have a .csv file that contains 191 columns, some of which are numeric
> and others are character data.
>
> I want to create an xts object, preserving the numerical data.
> I am not concerned about saving the character data.
>
> The date field is a character field in the 3rd column of the the .csv file,
> in the format %Y-%m-%d.
>
> These are the steps I took.  I used some different variable names so
> I could back up if I didn't get the result I was expecting:
>
> I am curious to know of other approaches, other than combining some of the
> lines, or if there
> are problems with this approach.
>
> ---code---
>
> library("quantmod")
> x = "mixed_data.csv"
> x1.csv = read.csv(x, sep=',', as.is=TRUE)
> x.dates = as.POSIXct(x1.csv[,3], format="%Y-%m-%d")
> x2.csv = lapply(x1.csv,as.numeric)  #generates a list with NAs for all chr
> fields
> x3.csv = data.frame(x2.csv)
> x.zoo = zoo(x3.csv, order.by=x.dates)
> x.xts = xts(x.zoo)
>
> ---end code---
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Extracting-numeric-data-from-a-mixed-data-csv-file-tp4668030.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> _______________________________________________
> R-SIG-Finance mailing list
> R-SIG-Finance@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>
> End of R-SIG-Finance Digest, Vol 108, Issue 24
> **********************************************
>

	[[alternative HTML version deleted]]

