Re: [R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread Marine Regis
Thanks a lot for your answers. Peter: sorry, here is the missing information: * I use the function gam() of the package �mgcv� * Yes, the output changes when I use offset(log_trap_eff) instead of offset=log_trap_eff. By using offset(log_trap_eff), the output is more coherent with the obs

Re: [R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread peter dalgaard
> On 22 Nov 2016, at 23:07 , Bert Gunter wrote: > > Define "very different." Sounds like a subjective opinion to me, for > which I have no response. Apparently others are similarly flummoxed. > Of course they would not in general be identical. Er? I don't see much reason to disagree that a ran

Re: [R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread Cade, Brian
Well part of the issue is that the negative binomial estimates are for means and they can differ a fair bit from the raw counts, but I'm also guessing that part of the issue is that the offset may not be accounted for with the predict.gam() function. Brian Brian S. Cade, PhD U. S. Geological Sur

Re: [R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread David Winsemius
> On Nov 22, 2016, at 1:29 PM, Marine Regis wrote: > > Hello, > >> From capture data, I would like to assess the effect of longitudinal changes >> in proportion of forests on abundance of skunks. To test this, I built this >> GAM where the dependent variable is the number of unique skunks and

Re: [R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread Bert Gunter
Define "very different." Sounds like a subjective opinion to me, for which I have no response. Apparently others are similarly flummoxed. Of course they would not in general be identical. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticki

[R] GAM with the negative binomial distribution: why do predictions no match with original values?

2016-11-22 Thread Marine Regis
Hello, >From capture data, I would like to assess the effect of longitudinal changes >in proportion of forests on abundance of skunks. To test this, I built this >GAM where the dependent variable is the number of unique skunks and the >independent variables are the X coordinates of the centroid

Re: [R] Memory problem

2016-11-22 Thread Henrik Bengtsson
On Windows 32-bit I think (it's been a while) you can push it to 3 GB but to go beyond you need to run R on 64-bit Windows (same rule for all software not just R). I'm pretty sure this is already documented in the R documentation. Henrik On Nov 22, 2016 19:49, "Ista Zahn" wrote: Not convenient

Re: [R] Memory problem

2016-11-22 Thread Jeff Newmiller
Ah, you also need to use a 64-bit operating system. Depending on the age of your hardware this may also mean you need a new computer. There are ways to process data on disk for certain algorithms, but you will be glad to leave them behind once the opportunity arises, so you might as well do so

Re: [R] Memory problem

2016-11-22 Thread Ista Zahn
Not conveniently. Memory is cheap, you should buy more. Best, Ista On Nov 22, 2016 12:19 PM, "Partha Sinha" wrote: > I am using R 3.3.2 on win 7, 32 bit with 2gb Ram. Is it possible to use > more than 2 Gb data set ? > > Regards > Partha > > [[alternative HTML version deleted]] > > ___

Re: [R] The code itself disappears after starting to execute the for loop

2016-11-22 Thread Maram SAlem
Thanks for helping Jim. I'm actually using the pbapply function together with the print function within a loop. In earlier versions, the progress bar and the output of the print function used to appear after each iteration of the loop. But with the 3.3.1. Version nothing appears, instead the c

Re: [R] Memory problem

2016-11-22 Thread Marcus Nunes
Yes. If you cannot read the dataset with the usual means, using functions like read.table or read.csv, try the ff package: https://cran.r- project.org/web/packages/ff/index.html. Best, On Tue, Nov 22, 2016 at 2:16 PM, Partha Sinha wrote: > I am using R 3.3.2 on win 7, 32 bit with 2gb Ram. Is

Re: [R] Memory problem

2016-11-22 Thread Bert Gunter
Depends how you use it. e.g. it can be stored on disk and worked with in pieces. Or some packages work with virtual memory, I believe. However, it is certainly not possible to read it into R. In fact, you probably won't be able to handle more (and maybe much less) than about 500 mb in R. Cheers,

[R] Memory problem

2016-11-22 Thread Partha Sinha
I am using R 3.3.2 on win 7, 32 bit with 2gb Ram. Is it possible to use more than 2 Gb data set ? Regards Partha [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

Re: [R] Getting the index of specific quantiles

2016-11-22 Thread Matteo Richiardi
Thanks Sarah (and all the others who replied) for your precious suggestions! Matteo On 22 November 2016 at 14:18, Sarah Goslee wrote: > Here's how to get one: > > x <- c(9,9,1,3,2,7,6,10,5,6) >> which.min(abs(x - quantile(x, .25))) > [1] 4 > > And here's one of the various ways to get the entire

Re: [R] Getting the index of specific quantiles

2016-11-22 Thread William Dunlap via R-help
You might try something like x <- c(9,9,1,3,2,7,6,10,5,6) p <- (0:4)/4 order(x) [ quantile(seq_along(x),p, type=1) ] # [1] 3 4 7 1 8 Selecting which value of 'type' works makes my head hurt. You could also use 1+(p*(length(x)-1) as the index into order(x). Bill Dunlap TIBCO Software w

Re: [R] Getting the index of specific quantiles

2016-11-22 Thread David Winsemius
> On Nov 22, 2016, at 4:21 AM, Matteo Richiardi > wrote: > > Dear R-users, > a very easy one for you, I guess. I need to extract the indexes of the > elements corresponding to different quantiles of a vector. When a > quantile is an interpolation between two adjacent values, I need the > index

[R] Fast continious wavelet transformation (CWT) and plot?

2016-11-22 Thread stvienna wiener
Dear all, This is my test code: library(wmtsa) sunspotsLong <- rep(sunspots, times=3000) ## try "times=30" (or 300) sunspots.cwt <- wavCWT(sunspotsLong) plot(sunspots.cwt, series=TRUE) If you adapt times in the second line with "30", the code works. But 300 or 3000 not so much. Are there more

Re: [R] Getting the index of specific quantiles

2016-11-22 Thread Sarah Goslee
Here's how to get one: x <- c(9,9,1,3,2,7,6,10,5,6) > which.min(abs(x - quantile(x, .25))) [1] 4 And here's one of the various ways to get the entire set: > xq <- quantile(x) > sapply(xq, function(y)which.min(abs(x - y))) 0% 25% 50% 75% 100% 34718 Sarah On Tue, Nov 22,

Re: [R] Breaking down a list into a table

2016-11-22 Thread Ulrik Stervbo
Hi Ferri, It sounds like the function 'separate' from the tidyr package is what you look for, HTH Ulrik On Tue, 22 Nov 2016 at 14:49 Ferri Leberl wrote: Dear All, I asked for support to deal with a hirarchy within a character separated list. I solved the problem crudely but effectively by -

[R] Breaking down a list into a table

2016-11-22 Thread Ferri Leberl
Dear All, I asked for support to deal with a hirarchy within a character separated list. I solved the problem crudely but effectively by - Choosing for a TSV as input, where in columns that may contain several (or as well no) items the items are separated via semicolon - adding semicolons to th

[R] Getting the index of specific quantiles

2016-11-22 Thread Matteo Richiardi
Dear R-users, a very easy one for you, I guess. I need to extract the indexes of the elements corresponding to different quantiles of a vector. When a quantile is an interpolation between two adjacent values, I need the index of the value which is closer (the lower value - or the higher value for w

Re: [R] how to use vector of values to change row order of a heatmap

2016-11-22 Thread PIKAL Petr
Hi Heatmap does not work with data frames (at least the version I have) > b=as.data.frame(matrix(c(3,4,5,8,9,10,13,14,15,27,19,20),3,4)) > heatmap(b) Error in heatmap(b) : 'x' must be a numeric matrix With matrix, heatmap works as expected. > b=matrix(c(3,4,5,8,9,10,13,14,15,27,19,20),3,4) > he

Re: [R] Melt and compute Max, Mean, Min

2016-11-22 Thread PIKAL Petr
Hi Well, thean you could try as I sugested. .mean <- apply(temp[,-(1:3)],1, mean, na.rm=T) .max <- apply(temp[,-(1:3)],1, max, na.rm=T) .min <- apply(temp[,-(1:3)],1, min, na.rm=T) temp2 <- data.frame(temp[,1:3], maxim = .max, minim = .min, aver = .mean) You should construct a cycle, read the ye

Re: [R] using conditionals to select rows in data.table

2016-11-22 Thread Martin Maechler
Dear Carl, this came through fine, as text only ... but then I did not see any question anymore. Best regards, Martin Maechler (R core and mailing list "operator") > Carl Sutton via R-help > on Tue, 22 Nov 2016 05:38:49 + writes: > Hopefully the attached is text and not htm