[R] zero-inflated negative binomial model with random effects

2014-01-04 Thread Santiago Guallar
Hi, I'd like to incorporate a random intercept in a zero-inflated negative binomial model. Package pscl is great but does not allow random effects, and package MCMCglmm doesn't support the negative binomial. I'm aware that package glmmADMB supported both random effects and the negative binomial

Re: [R] speed up a function

2013-07-15 Thread Santiago Guallar
Dear Petr, Sorry for the delay. I've been out. Unfortunately, your code doesn't work either even when using fromLast = T. Thank you for your help and your time. Santi > > From: PIKAL Petr >To: Santiago Guallar >Cc: r-help >Sent: W

Re: [R] spped up a function

2013-07-08 Thread Santiago Guallar
6933 15135 2011-06-10 05:53:00dry Santi >________ > From: PIKAL Petr >To: Santiago Guallar ; r-help >Sent: Monday, July 8, 2013 11:34 AM >Subject: RE: [R] spped up a function > > >Hi > >It seems to me, that you basically want merge, but I can miss the po

[R] spped up a function

2013-07-02 Thread Santiago Guallar
Hi, I have written a function to assign the values of a certain variable 'wd' from a dataset to another dataset. Both contain data from the same time period but differ in the length of their time intervals: 'GPS' has regular 10-minute intervals whereas 'xact' has irregular intervals. I attached

[R] modify and append new rows to a data.frame using ddply

2013-06-10 Thread Santiago Guallar
Hi, I have a data.frame that contains a variable act which records the duration (in seconds) of two states (wet-dry) for several individuals (identified by Ring) over a period of time. Since I want to work with daytime (i.e. from sunrise till sunset) and night time (i.e. from sunset till next s

[R] modify and append new rows in a dataframe

2013-06-08 Thread Santiago Guallar
My data frame shows changes on the variable act which records the consecutive duration (in seconds) of two states (wet-dry) over a few days for several  individuals (identified by Ring). Since I want to work with daytime (i.e. from dawn till dusk) and night time (i.e. from dusk till next dawn), I

Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Santiago Guallar
Great Barry! Thanks for your time. I will e-mail the package maintainers.   Santi From: Barry Rowlingson >To: Santiago Guallar >Cc: "r-help@r-project.org" >Sent: Wednesday, February 20, 2013 1:36 PM >Subject: Re: [R] Cramer von Mises test for a discrete distribution &

Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Santiago Guallar
rom: Barry Rowlingson >To: Santiago Guallar >Cc: "r-help@r-project.org" >Sent: Tuesday, February 19, 2013 6:20 PM >Subject: Re: [R] Cramer von Mises test for a discrete distribution > >On Tue, Feb 19, 2013 at 2:49 PM, Santiago Guallar wrote: >> Hi, >>

[R] Cramer von Mises test for a discrete distribution

2013-02-19 Thread Santiago Guallar
Hi,   I'm trying to carry out Cramer von Mises tests between pairs of vectors belonging to a discrete distribution (concretely frequencies from 0 to 200). However, the program crashes in the attempt. The problem seems to be that these vectors only have positive integer numbers (+ zero). When I a

[R] inserting jpg

2012-12-07 Thread Santiago Guallar
I’m trying to insert 8 jpg files with the main moon phases in a plot using read.image. My code:   ## Images   library(ReadImages) c1 = read.jpeg( '1c.jpg' ) c2 = read.jpeg( '2c.jpg' ) c3 = read.jpeg( '3c.jpg' ) d1 = read.jpeg( '1d.jpg' ) d2 = read.jpeg( '2d.jpg' ) d3 = read.jpeg( '3d.jpg' ) f

Re: [R] Imposing more than one condition to if

2012-07-18 Thread Santiago Guallar
Great! Thank you ever so much Rui. Santi > > From: Rui Barradas >To: Santiago Guallar >Cc: r-help@r-project.org >Sent: Wednesday, July 18, 2012 8:29 PM >Subject: Re: [R] Imposing more than one condition to if > >Hello, > >You&#

Re: [R] Imposing more than one condition to if

2012-07-18 Thread Santiago Guallar
le(x$lig == 0)}     Santi From: Rui Barradas >To: Santiago Guallar >Cc: r-help@r-project.org >Sent: Wednesday, July 18, 2012 11:37 AM >Subject: Re: [R] Imposing more than one condition to if > >hELLO, > >There was no nedd to change the names of the variables inside the >fucnti

Re: [R] Imposing more than one condition to if

2012-07-17 Thread Santiago Guallar
$dtime[ idusk ]     z$dawn <- NA     }     z } do.call(rbind, by(z, z$date, f))   Again, I attached a dput() with the object z which contains my dataset.   Santi From: Rui Barradas >To: Santiago Guallar >Cc: r-help@r-project.org >Sent: Tuesday, July 17, 2012 11:52 AM >Su

Re: [R] Imposing more than one condition to if

2012-07-17 Thread Santiago Guallar
date, f))   Again, I attached a dput() with the object z which contains my dataset.   Santi From: Rui Barradas >To: Santiago Guallar >Cc: r-help@r-project.org >Sent: Tuesday, July 17, 2012 11:52 AM >Subject: Re: [R] Imposing more than one condition to if > > >>Hello, >

[R] Imposing more than one condition to if

2012-07-15 Thread Santiago Guallar
Hi,   I have a dataset which contains several time records for a number of days, plus a variable (light) that allows to determine night time (lihgt= 0) and daytime (light> 0). I need to obtain get dusk time and dawn time for each day and place them in two columns. This is the starting point (d)

Re: [R] creating a new column assigning values of other columns

2012-05-06 Thread Santiago Guallar
;1970-01-01") # it works but adds 1 hour (!!!) niga$isnight=niga$night - as.difftime ( 1, units= "hours" ) # subtraction of 1 hour Thank you very much for your time!   Santi From: R. Michael Weylandt >To: Santiago Guallar >Cc: "r-help@r-project.org" >Sent: Su

Re: [R] creating a new column assigning values of other columns

2012-05-06 Thread Santiago Guallar
ils to be met). Attached the outputs you suggested (thanks, by the way, I didn't know dput()). Hope they go through this time.   Thank you,   Santi   *niga$isnight<- as.POSIXct( niga$nit, tz="GMT", format="%Y-%m-%d %H:%M:%S", origin="2007-06-19" )   From: R

Re: [R] Subtract days to dates in POSIXct format

2012-05-01 Thread Santiago Guallar
;m", "y"))) C<-subset(B,B$m==1) # January data; the bird was in South Atlantic waters write.table(C) Thank you very much for your help, Santi > > From: Jeff Newmiller >To: Santiago Guallar >Cc: "r-help@r-project.org" &

Re: [R] Subtract days to dates in POSIXct format

2012-04-30 Thread Santiago Guallar
_____ > From: Jeff Newmiller >To: Santiago Guallar >Cc: "r-help@r-project.org" >Sent: Monday, April 30, 2012 5:51 PM >Subject: Re: [R] Subtract days to dates in POSIXct format > >On Mon, 30 Apr 2012, Santiago Guallar wrote: > >> Hello, >> >> I&#

[R] Importing files

2012-03-18 Thread Santiago Guallar
Hello, I'm trying to import into R files that contain data downloaded from logger devices as files with the following formats: .act .lig .trj .trn These files are essentially text files but use both tabs and commas as separators. I've tried the function scan: 1) scan("filename.act", what=charact

[R] Automated generation of combinations

2011-09-12 Thread Santiago Guallar
Hello,   I'd like to generate automatically all the possible combinations of a set of 8 variables (there are 535, too many to do it by hand). For example:   input: varA, varB, varC output: varA+varB+varC varA+varB varA+varC varB+varC varA