_
De : Bert Gunter
Envoy� : samedi 20 juillet 2019 00:46
� : Marine Regis
Cc : r-help@r-project.org
Objet : Re: [R] Check to see if a value is included within intervals
If I understand correctly (make sure that I do!), ?findInterval should
essentially do what you want.
I
Hello all,
The R code below tests if values of the variable �t� are included or not within
intervals that are defined from the data frame dat. The expected results are
displayed using the function "rle" (see code below). Here is the code:
ta <- 100
tb <- 140
tc <- 40
td <- 85
datF <- data.fram
Hello all,
Is there an efficient way to simplify the loop over the 3rd dimension of a 3D
array ? I want to keep the loop over the "time". Here is the code:
set.seed(12345)
ind <- 10
time_seq <- seq(0, 8, 1)
col_array <- c(paste("time_", time_seq, sep=""))
tab <- array(0, dim=c(length(time_seq)
Hello All,
I am using the function "focal" in the R package "raster" but I don�t
understand how the function calculates values for neighboring cells that are
located at the raster edge. Here is an example reproducible:
f <- matrix(1, nrow=3, ncol=3)
f[c(1,3,7,9)]=1/sqrt(2)
f[5]=0
func <- funct
on
Envoyé : mardi 8 août 2017 14:48
À : Marine Regis; r-help@r-project.org
Objet : RE: Latin hypercube sampling from a non-uniform distribution
> However, my variable is simulated from the cumulative distribution function
> of the Poisson distribution.
Then I am afraid I don't know what you
_probability")
X <- randomLHS(100, length(parm))
colnames(X) <- c("var1", "var2", "mortality_probability")
X[, "mortality_probability"] <- qpois(X[, "mortality_probability"], 0.9)
hist(X[, "mortality_probability"])
Thanks for you
Hello,
I am performing a sensitivity analysis using a Latin Hypercube sampling.
However, I have difficulty to draw a Hypercube sample for one variable. I�ve
generated this variable from a Poisson distribution as follows:
set.seed(5)
mortality_probability <- round(ppois(seq(0, 7, by = 1), lambda
____
De : David Winsemius
Envoyé : mercredi 21 juin 2017 22:30
À : Marine Regis
Cc : r-help@r-project.org
Objet : Re: [R] How to apply a system of ordinary differential equations to a
cell grid?
> On Jun 21, 2017, at 12:48 PM, Marine Regis wrote:
>
> Hello,
>
> I am developing an
Hello,
Is it possible to generate simulated data that look like the attached figure?
The curve in the figure can be obtained from this equation respecting some
conditions:
if(Temperature > T_min & Temperature < T_max){
a*( Temperature -T_min)*( Temperature -T_max)
} else 0
T_min ~ Unif
David Winsemius
Envoyé : mercredi 21 juin 2017 22:30
À : Marine Regis
Cc : r-help@r-project.org
Objet : Re: [R] How to apply a system of ordinary differential equations to a
cell grid?
> On Jun 21, 2017, at 12:48 PM, Marine Regis wrote:
>
> Hello,
>
> I am developing an agent-based m
Hello,
I am developing an agent-based model to simulate the spread of infectious
diseases in heterogeneous landscapes composed of habitat polygons (or clumps of
connected cells). To simplify the model, I consider a habitat grid (or raster)
containing the polygon ID of each cell. In addition, I
Hello,
I would like to randomly select one row by group from a matrix. Here is an
example where there is one row by group. The code gives an error message:
test <- matrix(c(4,4, 6,2, 1,2), nrow = 2, ncol = 3, dimnames = list(NULL,
c("xcor", "ycor", "id")))
do.call(rbind, lapply(split(test, test[,
)
Thanks in advance for your help!
Marine
De : David Winsemius
Envoyé : vendredi 24 mars 2017 06:01
À : Marine Regis
Cc : r-help@r-project.org
Objet : Re: [R] How to change parameter values as a function to time with the
package "deSolve"
> O
Hello,
I am trying to solve an ODE in R using deSolve. With the following code, I
expected the parameter �gamma0� takes the values 5 at time step 0, 1, 2, 3, 4,
5, 6, 7, 8, 9 and 10, and 0 otherwise. However, the print(gamma0) shows that
�gamma0� stays at 0.
Here is my ODE:
param <- c(a = 0.1
Hello,
How can I add x and y axis labels for a plot that is built from the function
plot.sensFun (package FME) ? I tested xlab ="Time" and ylab="Population size"
but this doesn't work for me.
Here is a code to generate the plot:
pars <- list(gmax = 0.5, eff = 0.5,
ks = 0.5, rB
e different between
models with offset=argument and offset().
Thanks a lot for your help.
Have a nice day
Marine
________
De : peter dalgaard
Envoy� : mardi 22 novembre 2016 23:52
� : Bert Gunter
Cc : Marine Regis; r-help@r-project.org
Objet : Re: [R] GAM with the negative
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
Hello,
I am a novice in Generalized Additive Models (GAMs) and I would need some
advice on these models. 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 th
Hello,
I used the function "mix" (package "mixdist'') to fit Gamma mixture
distributions. The function gives mu and sigma parameters (output below). How
can I find the scale and shape parameters of the Gamma distributions ?
Parameters:
pimu sigma
1 0.2089 185.7 285.4
2 0.7911 530.1
Hello,
I'm using the function gammamixEM from the package mixtools. How can I return
the graphical output of density as in the function normalmixEM (i.e., the
second plot in plot(x, density=TRUE)) ?
Thank you very much for your time.
Have a nice day.
Marine
[[alternative HTML versio
Hello,
I have two data frames with different sizes but with the same number of columns.
> df1 <- data.frame(col1 = c(1:6), col2 = c(rep("a", 3), rep("b", 3)), col3 =
> c(rep("AA", 2), rep("BB", 2), rep("CC", 2)), col4=c(1,8,6,9,7,6))
> df1
col1 col2 col3 col4
11a AA1
22
Hello,
I would like to add a counter column in a data frame based on a set of
identical rows. To do this, I tested:
DF = data.table(x=c("a","a","a","b","c","d","e","f","f"),
y=c(1,3,2,8,8,4,NA,NA,NA))
DF[ , Index := .GRP, by = c("y") ]
DF
However, the rows with NAs are considered to be ide
Hello,
I have a vector x of character strings:
x <- c("LM0122","RTG", "GF TYHH", "HJN 89963", "KFTR1","RT 8")
>From this vector, how can I extract the following character strings (i.e.,
>which contain 0 or 1 numeric value)
[1] "RTG" "GF TYHH" "KFTR1" "RT 8"
Thank you v
Hello,
I'm trying to run a code that uses the snowfall package. Here is the structure
of my code.
sfInit(parallel=T, cpus = 5, slaveOutfile="ErrorMessage.txt")
sfExportAll()
sfLibrary(rgdal)
sfLibrary(raster)
sfLibrary(sp)
sfLibrary(rgeos)
sfLibrary(snowfall)
system.time( sfClusterA
ice day.
Marine
De : Achim Zeileis
Envoyé : mercredi 30 mars 2016 12:05
À : Erich Neuwirth
Cc : Marine Regis; r-help@r-project.org
Objet : Re: [R] Compute the Gini coefficient
On Wed, 30 Mar 2016, Erich Neuwirth wrote:
>
>> On 30 Mar 2016, at 0
Hello,
I would like to build a Lorenz curve and calculate a Gini coefficient in order
to find how much parasites does the top 20% most infected hosts support.
Here is my data set:
Number of parasites per host:
parasites = c(0,1,2,3,4,5,6,7,8,9,10)
Number of hosts associated with each number of
Hello,
I have two rasters with different resolution and projection.
> r1
class : RasterLayer
dimensions : 2510, 5233, 13134830 (nrow, ncol, ncell)
resolution : 56, 56 (x, y)
extent : 503198, 796246, 4917498, 5058058 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=1
Hello,
>From this character string:
test <-"k0298_7832_8964"
how can I obtain:
[[1]]
"0298"
Thank you very much for your help.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https:
Hello everybody,
I have count data and with these data, I would like to build a mixed
model by using the function glmer(). In a first time, I calculated the c-hat of
a simple model with glm() to verify overdispersion and I found a c-hat = 18. I
also verified overdispersion in the mixed model
you very much for your help.
Have a good day
Marine
> CC: r-help@r-project.org
> From: dwinsem...@comcast.net
> To: marine.re...@hotmail.fr
> Subject: Re: [R] predict() from conditional logit model?
> Date: Thu, 12 Sep 2013 17:52:33 -0500
>
>
> On Sep 12, 2013, at 3:31
Hello everybody,
I used the function clogit() (package survival) to build a conditional logit
model. This is the R output of my model :
coef exp(coef) se(coef) robust se z
Pr(>|z|)
anthro 2.14776 8.56565 0.09352 0.53989 3.978 6.94e-05 ***
cor 0.92365 2.51846 0.07757 0.41944 2.202 0.0
31 matches
Mail list logo