[R] turning a list of vectors into a data.frame (as rows of the DF)?

2012-01-11 Thread Chris Conner
As a newer R practicioner, it seems I stump myself weekly (at least) with issues that have spinning my wheels.  Here is yet another... I'm trying to turn a list of numeric vectors (of uneual length) inot a dataframe.  Each vector held in the list represents a row, and there are some rows of

[R] Please help!! How do I set graphical parameters for ploting ctree()

2012-01-06 Thread Chris Conner
I'm trying to understand how to set graphical parameters for trees created with the party package.  For example take the following code:   library(party)     data(airquality)     airq - subset(airquality, !is.na(Ozone))     airct - ctree(Ozone ~ ., data = airq,    controls =

[R] using dcast to reshape a DF from long to wide with multiple measured variables per obs

2011-12-11 Thread Chris Conner
I have data in the following format:   person- c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3) v2- c(2011-01-01, 2011-02-01, 2011-03-01, 2011-04-01, 2011-01-01, 2011-02-01, 2011-03-01, 2011-04-01, 2011-05-01, 2011-01-01, 2011-02-01, 2011-03-01, 2011-04-01, 2011-05-01, 2011-06-01) v3 - rep(30, 15) DF

[R] Help with recast() syntax

2011-11-28 Thread Chris Conner
Dear Help-Rs,   I have data similar to the following:   DF - structure(list(X = 1:22, RESULT = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c(NEG, POS), class = factor), YR_MO = c(201011L, 201012L, 201101L, 201102L, 201103L,

[R] couting events by subject with black out windows

2011-11-18 Thread Chris Conner
I large datset that includes subjects(ID), Dates and events that need to be counted.  Not every date includes an event, and I need to only count one event per 30days, per subject.  So in essence, I need to create a 30-day black out period during which time an event cannot be counted for each

[R] Group based trajectory modeling in R? Is there a way?

2011-10-20 Thread Chris Conner
I have been searching the web for an answer on whether there is a package for group-based trajectory modeling in R.  Something along the lines of what PROC TRAJ (http://www.andrew.cmu.edu/user/bjones/index.htm) accomplishes in SAS.  Does anyone have any experience working with a package that

Re: [R] is there an option to turn off scientific notation in write.csv

2011-10-14 Thread Chris Conner
Subject: Re: [R] is there an option to turn off scientific notation in write.csv On 10/14/2011 05:25 AM, Chris Conner wrote: Dear Help-Rs,   I'm working with a file that contains large numbers and I need to export them as is.  for example take:   x - c

[R] is there an option to turn off scientific notation in write.csv

2011-10-13 Thread Chris Conner
Dear Help-Rs,   I'm working with a file that contains large numbers and I need to export them as is.  for example take:   x - c(27104010002005,27104020001805,27104090001810,90050013000140,90050013000120) y - c(1:5) df - data.frame(cbind(x,y))   When I then try a simple:

[R] Issue with read.csv treatment of numerics enclosed in quotes (and a confession)

2011-10-05 Thread Chris Conner
Dear Help-Rs,   I've been dealing with this problem for some time, using a work-around to deal with it. It's time for me to come clean with my ineptitude and seek a what has got to be a more streamlined solution from the Help-Rverse.   I regularly import delimited text data that contains

[R] Returning vector of values shared across 3 vectors?

2011-10-01 Thread Chris Conner
Help-Rs,   I've got three vectors representing participants:   vec1 - c(4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81) vec2 - c

[R] String manipulation with regexpr, got to be a better way

2011-09-29 Thread Chris Conner
Help-Rs,   I'm doing some string manipulation in a file where I converted a string date in mm/dd/ format and returned the date .   I've used regexpr (hat tip to Gabor G for a very nice earlier post on this function) in steps (I've un-nested the code and provided it and an example of

[R] producing an aggregate table of top 3 by cost

2011-09-26 Thread Chris Conner
Help-Rs   As someone who is newer to R and trying to make the transition from Access into R, there is a frequetnly used function that I'd like to try and duplicate in the R world.  It involved creating an aggregate table of the top (n)  orders for an item by sum of cost over a select period of