Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
Thanks Jim, I acted on your suggestion and found the result unchanged. :-( Then I noticed that fitdist doesn't like a sample size of 1 either. If, then, "drop = TRUE" results in all empty combinations of m_id, year and week being excluded, then (noticing the requirement is actually that the sam

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
OK, here is a stripped down variant of my code. I can run it here unchanged (apart from the credentials for connecting to my DB). Sys.setenv(MYSQL_HOME='C:/Program Files/MySQL/MySQL Server 5.0') > library(TSMySQL) > library(plyr) > library(fitdistrplus) > con <- dbConnect(MySQL(), user="rejbyers

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread jim holtman
try 'drop=TRUE' on the split function call. This will prevent the NULL set from being sent to the function. On Mon, Jul 12, 2010 at 3:10 PM, Ted Byers wrote: > >From the documentation I have found, it seems that one of the functions from > package plyr, or a combination of functions like split a

Re: [R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Erik Iverson
Your code is not reproducible. Can you come up with a small example showing the crux of your data structures/problem, that we can all run in our R sessions? You're likely get much higher quality responses this way. Ted Byers wrote: From the documentation I have found, it seems that one of th

[R] exercise in frustration: applying a function to subsamples

2010-07-12 Thread Ted Byers
>From the documentation I have found, it seems that one of the functions from package plyr, or a combination of functions like split and lapply would allow me to have a really short R script to analyze all my data (I have reduced it to a couple hundred thousand records with about half a dozen recor