Re: [R] How to split a data.frame into its columns?

2016-08-28 Thread David Winsemius
> On Aug 28, 2016, at 11:14 PM, Marius Hofert > wrote: > > Hi, > > I need a fast way to split a data.frame (and matrix) into a list of > columns. This is a bit of a puzzle since data.frame objects are by definition "lists of columns". If you want a data.frame object (say it's name is dat) t

Re: [R] How to split a data.frame into its columns?

2016-08-28 Thread Jeff Newmiller
Need to re-read the "Introduction to R". Data frames ARE lists of columns. So to convert a matrix to a list of vectors use as.data.frame( m ) -- Sent from my phone. Please excuse my brevity. On August 28, 2016 11:14:20 PM PDT, Marius Hofert wrote: >Hi, > >I need a fast way to split a data.fra

[R] How to split a data.frame into its columns?

2016-08-28 Thread Marius Hofert
Hi, I need a fast way to split a data.frame (and matrix) into a list of columns. For matrices, split(x, col(x)) works (which can then be done in C for speed-up, if necessary), but for a data.frame? split(iris, col(iris)) does not work as expected (?). The outcome should be lapply(seq_len(ncol(iris

Re: [R] parsing the file

2016-08-28 Thread Jeff Newmiller
Based on the discussion of ORing values with characters in [1] which may generate "unusual" characters I suspect a botched conversion from EBCDIC may have messed with some of the data. If there are signed data fields then OP may need to read the original file and treat it as if it were binary da

Re: [R] package.skeleton, environment argument causes error

2016-08-28 Thread Uwe Ligges
It would be helpful for us if you provide a reproducible examples when the current package.skeleton fails. Best, Uwe Ligges On 19.08.2016 00:12, Jacob Strunk wrote: Hello, I have been using package.skeleton from within an lapply statement successfully (assuming good source code) with the fol

Re: [R] package.skeleton fails

2016-08-28 Thread Uwe Ligges
Your code works for me, and I do not see any lapply in the example you provide below. Best, Uwe Ligges On 24.08.2016 21:21, Strunk, Jacob (DNR) wrote: Hello, I have been using package.skeleton from within an lapply statement successfully (assuming good source code) with the following setup i

Re: [R] parsing the file

2016-08-28 Thread jim holtman
Here is an attempt at parsing the data. It is fixed field so the regular expression will extract the data. Some does not seem to make sense since it has curly brackets in the data. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not h