Re: [R] spsurvey analysis

2013-11-01 Thread Tim Howard
Water Pollution Control Laboratory 6543 N Burlington Avenue Portland, OR 97203-5452 503-823-1038 jason@portlandoregon.gov -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tim Howard Sent: Friday, November 01, 2013 7:49 AM To: r-h

[R] spsurvey analysis

2013-11-01 Thread Tim Howard
All, I've used the excellent package, spsurvey, to create spatially balanced samples many times in the past. I'm now attempting to use the analysis portion of the package, which compares CDFs among sub-populations to test for differences in sub-population metrics. - My data (count data) have

Re: [R] update.packages fails on pdf write - CSAgent

2013-10-03 Thread Tim Howard
) y <- list.files(pattern = ".zip") install.packages(pkgs = y, repos = NULL, lib = "C:/pathToLocationWhereWritesAreAllowed") #now manually copy the folders to the R installation and overwrite the existing ones. Tim >>>>>>>>>>>>>>>>> Dat

[R] update.packages fails on pdf write - CSAgent

2013-10-02 Thread Tim Howard
All, I work in a building where our computers are running Windows XP with Cisco Security Agent (CSA) activated, locking many automated actions, especially file writes. We (lowly staff) are allowed to install software, so on upgrading to R 3.0.2, I tried the standard approach for updating my package

Re: [R] read.csv quotes within fields

2013-01-28 Thread Tim Howard
Yes! This does this trick. Thank You! Tim >>> peter dalgaard 1/26/2013 11:49 AM >>> On Jan 26, 2013, at 16:32 , Tim Howard wrote: > Duncan, > Good point - I guess I am expecting too much. I'll work on a global replace > before import or chopping with str

Re: [R] read.csv quotes within fields

2013-01-26 Thread Tim Howard
ction=showCaseDownloadForm (see off-airport AEA 2005 for a csv with issues.) Thank you for the help. I really do appreciate the suggested solutions. Also, thanks to John Kane for the link to csvEdit. Tim >>> Duncan Murdoch 01/25/13 6:37 PM >>> On 13-01-25 4:37 PM, Tim Howard wrote: > Da

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
x27;s the case, I'd think there would be a solution within read.csv() ... or perhaps scan()?, I just can't figure it out. best, Tim >>> David Winsemius 1/25/2013 4:16 PM >>> On Jan 25, 2013, at 11:35 AM, Tim Howard wrote: > Great point, your fix (quote="

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
nd* quotes with the escape character within a single string. Tim >>> David Winsemius 1/25/2013 2:27 PM >>> On Jan 25, 2013, at 10:42 AM, Tim Howard wrote: > All, > > I have some csv files I am trying to import. I am finding that quotes inside > strings are e

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
C=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base >>> Tim Howard 1/25/2013 1:42 PM >>> All, I have some csv files I am trying to import. I am finding that quotes inside str

[R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
All, I have some csv files I am trying to import. I am finding that quotes inside strings are escaped in a way R doesn't expect for csv files. The problem only seems to rear its ugly head when there are an uneven number of internal quotes. I'll try to recreate the problem: # set up a matrix,

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Tim Howard
Jessica, In terms of initializing your list for populating it in a later step, I think this partially gets at your question -- it removes the upper loop assignment, but then does require a loop to get the second level. Perhaps there's something here you can work with ... height<-c("high","lo

Re: [R] bootstrap means by strata

2011-10-13 Thread Tim Howard
Answering my own question. ?sample (!) y <- by(x, x$TrSeasYr, function(x) mean(sample(x[,1], size=999, replace = TRUE))) >>> Tim Howard 10/13/2011 9:42 AM >>> All - I have an uneven set of replicates and would like to sample from this set X number of times to gen

[R] bootstrap means by strata

2011-10-13 Thread Tim Howard
All - I have an uneven set of replicates and would like to sample from this set X number of times to generate a mean for each grouping variable. I was thinking the boot package would be the thing to use, but now I'm not so sure ... given the discussion here: http://finzi.psych.upenn.edu/Rhel

Re: [R] assign factor levels based on list

2011-02-10 Thread Tim Howard
t;fig", "banana")) > y[ , names(my.factor.defs)] <- lapply(names(my.factor.defs), function(x) { +y[[x]] <- factor(y[[x]] , levels= my.factor.defs[[x]])}) > str(y) 'data.frame': 3 obs. of 3 variables: $ colOne : Factor w/ 6 levels "1",

[R] assign factor levels based on list

2011-02-09 Thread Tim Howard
All, Given a data frame and a list containing factor definitions for certain columns, how can I apply those definitions from the list, rather than doing it the standard way, as noted below. I'm lost in the world of do.call, assign, paste, and can't find my way through. For example: #set up d

Re: [R] apply over list of data.frames

2010-11-24 Thread Tim Howard
one = data.frame(x = c(1,2,3), y = c(1,2,2), z = c(3,1,1)), two = data.frame(x = c(2,5,2), y = c(2,3,1), z = c(4,1,2)) ) Reduce("+", DF.lis) / length(DF.lis) I hope it helps. Best, Dimitris On 11/24/2010 8:37 PM, Tim Howard wrote: > R users, > This probably involves a s

[R] apply over list of data.frames

2010-11-24 Thread Tim Howard
*y+3)) } #show the list > x $one a b c 1 1 2 3 2 2 3 4 3 3 4 5 $two a b c 1 4 5 9 2 8 6 10 3 12 7 11 #the result should be a b c 1 2.5 3.5 6 2 5 4.5 7 3 7.5 5.5 8 Can anyone direct me down the right path? Thanks in advance Tim Howard [[alternative HTML version dele

Re: [R] Force evaluation of variable when calling partialPlot

2010-11-16 Thread Tim Howard
then use the 'names' of the imp data frame to be absolutely clear to RF you are talking about the same variables for(i in length(sel.imp){ partialPlot(sel.rf,xdata,names(sel.imp[i]),which.class=1,xlab=vars[i],main="") } Hope that helps. Tim Howard >>>>

Re: [R] Random Forest - Strata

2010-07-21 Thread Tim Howard
Coll, An alternative approach is to do that subsetting yourself before sending it to RF and treat each group as an external validation group, as follows: - extract Site A, build a RF model (Model 1) on sites B and C - validate this model by running a predict on site A using the model, use ROCR o

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
Got it. Thanks again so much for the help. Best, Tim >>> hadley wickham 3/10/2010 2:46 PM >>> > By Q2 I was trying to refer to the Y-axis labels. For the polar plot, the > Y-axis labels reside left of the panel. I was looking for a way to get the > Y-axis labels to radiate out from the cente

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
ou can also use scale_y_sqrt(). Hadley On Wed, Mar 10, 2010 at 2:05 PM, Tim Howard wrote: > To answer two of my own questions to get them into the archives (I am slowly > getting the hang of ggplot): > > Q1. use "opts(axis.text.x = theme_text(size=xx))" to change f

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
geom_bar(width=1) + opts(axis.text.x = theme_text(size = 18)) smp2 + coord_polar() Cheers, Tim >>> Tim Howard 3/9/2010 9:25 AM >>> Dear R gurus - consider this plot: library(ggplot2) dat <- sample(1:8,100,replace=TRUE) smp <- ggp

[R] ggplot2 rose diagram

2010-03-09 Thread Tim Howard
size of each slice, which makes for a different presentation than ggplot2. Any suggestions on how to use this calculation method in the ggplot framework? Thanks in advance for your help. Tim Howard New York Natural Heritage Program __ R-help@r-projec

Re: [R] pipe data from plot(). was: ROCR.plot methods, cross validation averaging

2009-09-24 Thread Tim Howard
Tobias On Thu, Sep 24, 2009 at 3:09 PM, Tim Howard wrote: > All, > I'm trying again with a slightly more generic version of my first question. > I can extract the > plotted values from hist(), boxplot(), and even plot.randomForest(). Observe: > > # get some data > da

Re: [R] pipe data from plot(). was: ROCR.plot methods, cross validation averaging

2009-09-24 Thread Tim Howard
ll see if I can get in there and tweak it. Thanks to both of you for the help. Tim >>> David Winsemius 9/24/2009 9:43 AM >>> On Sep 24, 2009, at 9:09 AM, Tim Howard wrote: > All, > I'm trying again with a slightly more generic version of my first > questio

Re: [R] pipe data from plot(). was: ROCR.plot methods, cross validation averaging

2009-09-24 Thread Tim Howard
avid Winsemius 9/24/2009 9:25 AM >>> On Sep 24, 2009, at 9:09 AM, Tim Howard wrote: > All, > I'm trying again with a slightly more generic version of my first > question. I can extract the > plotted values from hist(), boxplot(), and even plot.randomForest(). > Ob

[R] pipe data from plot(). was: ROCR.plot methods, cross validation averaging

2009-09-24 Thread Tim Howard
n't use this method in ROCR library(ROCR) data(ROCR.xval) RCdat <- plot(perf, avg="threshold") RCdat ## output: NULL Does anyone have any tricks for piping or extracting these data? Or, perhaps for steering me in another direction? Thanks, Tim From: "Tim Howard" Sub

[R] ROCR.plot methods, cross validation averaging

2009-09-23 Thread Tim Howard
st entry with only two values p...@x.values[[1]] <- c(0,1) p...@y.values[[1]] <- c(0,1) p...@alpha.values[[1]] <- c(Inf,0) plot(perf, avg="threshold") ##output results in an error with this message # Error in if (from == to) rep.int(from, length.out) else as.vector(c(from, : #

Re: [R] rzinb (VGAM) and dnbinom in optim - Solved.

2008-04-19 Thread Tim Howard
; phi <- xx[1] > size <- xx[2] > munb <- xx[3] > -sum(dzinb(x=x,phi=phi, size=size, munb=munb,log=TRUE)) >} > > solut <- optim(fn=fncZiNB,par=c(0.09, 72, 0.7),x=x,method = >"L-BFGS-B", lower=c(1e-10,1e-10,1e-10),upper=c(1-1e-10,Inf,Inf), >con

[R] rzinb (VGAM) and dnbinom in optim

2008-04-18 Thread Tim Howard
b=72, size=0.7),method = > "L-BFGS-B", hessian=TRUE) Error in dnbinom(x = x, size = size, prob = prob, log = log.arg) : argument "size" is missing, with no default I have the same problem with dnbinom. I'm sure I'm doing something obvious any suggestions?