Displaying 20 results from an estimated 7000 matches similar to: "monitor variable change"
2010 Sep 17
4
count frequency
Hello everyone,
please consider the following lines of a matrix
[574,] 59 32
[575,] 59 32
[576,] 59 32
[577,] 59 32
[578,] 59 32
[579,] 59 32
[580,] 59 32
[581,] 60 32
[582,] 60 33
[583,] 60 33
[584,] 60 33
[585,] 60 33
[586,] 60 33
[587,] 60 33
[588,] 60 33
[589,] 60 33
[590,] 60 33
[591,] 61 33
[592,] 61 33
[593,] 61
2006 Sep 06
4
problem with putting objects in list
Hi
I use the following code and it stores the results of density() in the
list dr:
dens <- function(run) { density( positions$X[positions$run==run], bw=3,
cut=-2 ) }
dr <- lapply(1:5, dens)
but the results are stored in dr[[i]] and not dr[i], i.e. plot(dr[[1]])
works, but plot([1]) doesn't.
Is there any way that I can store them in dr[i]?
Thanks a lot,
Rainer
--
Rainer M. Krug,
2011 Apr 27
1
Eval to write many files
Dear all
I am looking for a shorter way and more elegant to write the following
for (i in c(1:length(Shadowlist))){
filename<-paste('/home/apa/maps/',model,i,'.mat',sep="")
varname<-paste(model,'_shadow',i,sep="")
eval(parse(text=paste('writeMat(filename,',varname,'=Shadowlist[[i]])',sep="")))
}
actually I do not
2011 Mar 10
2
Not sure how to handle hazard in my survival model
Hi R experts :)
I'm trying to carry out a survival model on my data, but I am unsure of
whether it's appropriate or if I should do something specific in regards to
hazard.
My data is time to death by predator where I have 8 prey and one predator in
the setting. This means that two prey can't possibly die at the same time
and I can't quite get my head around how to include this in
2012 Aug 22
3
Question concerning anova()
Hi
I am comparing four different linear mixed effect models, derived from updating the original one. To
compare these, I want to use anova(). I therefore do the following (not reproducible - just to
illustration purpose!):
dat <- loadSPECIES(SPECIES)
subs <- expression(dead==FALSE & recTreat==FALSE)
feff <- noBefore~pHarv*year # fixed effect in the model
reff <-
2009 Oct 07
2
Second y-axis --- alternative to par(new=
Hi
is there an alternative to par(new), for ading data to a plot for a
different y-axis?
My problem with par(new=TRUE) is, that it re-defines all axis and labels (as
in example 1) and one has to use xlim=... to fix the x-axis.
I am looking for something, which simply resets the y-axis, so that a new
plot() (or points()/lines()) keeps the x-axis, but re-defines the y-axis.
Is there something
2008 Aug 01
1
bug in readRAST6 function in package spgrass6
Hi
if I try to import a raster layer which consists only of NULL values
from grass by using the readRAST6, I get an error message:
> readRAST6("HSericea_seedsDisperse_2007")
ERROR: Invalid value for null (integers only)
Error in readBinGrid(rtmpfl11, colname = vname[i], proj4string = p4,
integer = to_int) :
no such file:
2011 Jul 26
1
Comparing two pdf resulting from density() and identify where significantly smaller or larger?
Hi
this might be a little bit off topic, but here it goes: lets assume I have
the following:
set.seed(13)
dat1 <- rnorm(2000, mean=10, sd=10)
dat2 <- rnorm(100, mean=10, sd=20)
d.all <- density(dat, n=1024)
d.co <- density(x[[v]], , from=min(d.all$x), to=max(d.all$x),
n=1024)
d.diff <- list(
x = d.all$x,
2009 Oct 08
2
intersection of 2 density curves
Hi,
I would like to find out the coordinates of the intersection points of 2 density curves. I did a search but i didn't get any significant results. I really hope some of you have some ideas. here it is an example:
set.seed(123)
x1 <- rnorm(100, 1, 1)
x2 <- rnorm(100, 0, 1)
d1 <- density(x1)
d2 <- density(x2)
plot(d1, col = 2)
lines(d2, col = 4)
Now i would like to know
2011 Jan 10
2
write.table equivalent for lists?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I am writing simulations in R, and quite regularly, I have to save lists
and objects to HDD and load it later again.
So I am wondering: why is there no function to write lists (and S3, S4
objects) onto HDD WITHOUT keeping the name? What I mean is:
For data.frames I can use
x <- data.frame(x = runif(10))
write.table(x, "x.txt)
rm(x)
y
2011 Apr 14
2
Identify period length of time series automatically?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I have 10.000 simulations for a sensitivity analysis. I have done a few
sensitivity analysis for different response variables already,
but now, as most of the simulations (if not all) show some cyclic
behaviour, see how the independent input parameter influence the
frequency of the cyclic changes and "how cyclic" they actually are.
So
2009 Oct 30
2
Ubuntu packages compiled with 2.9
Hi
I upgraded to R 2.10.0, and I encounter a problem with some packages on R,
installed via apt-get..
They are still compiled by 2.9 and give me an warning when I load the
packages. Will these packages be recompiled with R 2.10, or should I rather
switch to self-compiling?
Cheers,
Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys.
2006 Sep 20
4
Calculating mean together with split
Hi
I have a table called npl containing results of simulations.
It contains about 19000 entries and the structure looks like this:
NoPlants sim run year DensPlants
1 6 lng_cs99_renosterbos 1 4 0.00192
.
.
.
it has 43 different entries for sim and year goes from 1 to 100, and run
from 1 to 5.
I would like to calculate the mean of DensPlants for each
2012 Aug 21
2
define subset argument for function lm as variable?
Hi
I want to do a series of linear models, and would like to define the input arguments for lm() as
variables. I managed easily to define the formula arguments in a variable, but I also would like to
have the "subset" in a variable. My reasoning is, that I have the subset in the results object.
So I wiould like to add a line like:
subs <- dead==FALSE & recTreat==FALSE
which
2009 Dec 11
1
Creating bibtex file of all installed packages?
Hi
is there an easy and fast way, to generate a BibTeX file of all installed /
loaded packages and R?
I know about toBibtex(citation()) to extract the BibTeX for a single
package, but how can I generate a file containg citations for all installed
/ loaded packages?
Cheers,
Rainer
--
NEW GERMAN FAX NUMBER!!!
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT),
2011 Feb 01
2
How to change size of xlab inplot?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I want to increase the size of the text for xlab in the plot command:
plot(1,1, xlab="Label")
I tried cex, cex.caption and others, but none worked. Is there a way of
using cex=2 for the xlab?
Thanks,
Rainer
- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)
Centre of
2011 Mar 11
2
How to get all combinations between two character vectors?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I know there is a function - I have used it before - but I always forget
what it is called...
I need the combination of two character vectors, i.e:
x <- c("a", "b")
y <- c("x", "y")
z <- THEFUNCTION(x, y)
z == c("ax", "ay", "bx", "by")
I promise I will
2010 Jul 29
2
Replace last element in a vector - elegant solution?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I have to replace the last element of a vector with 0, but the length of
x is not known at coding time. So I do the following:
x <- 1:10
x
x[length(x)] <- 0
x
it is working nicely, but I am wondering: is there a more elegant
solution( like tail(x, 1) <- 0 , which does not work)?
Thanks,
Rainer
- --
Rainer M. Krug, PhD (Conservation
2006 Oct 25
3
simplification of code using stamp?
Hi
I have the following code which I would like to simplify. Id does linear
regressions and returns the r-squares, and the coefficients.
It runs slow, as it is doing the regressions for each - is it possible
to get the values in a dataframe which looks as follow:
expert | xx | seeds | r.squared | slope | intercept
Thanks in advance,
Rainer
library(reshape)
rsqs <- as.data.frame(
2009 Jun 04
4
order() with randomised order in ties?
Hi
I want to use order() to get the order of a vector.
But I would need a different behavior when ties occur: similar to the
parameter ties.method = "random" in the rank() function, I would need
to randomise the ties. Is this possible?
Example:
x <- rep(1:10, 2)
order(x)
[1] 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20
order(x)
[1] 1 11 2 12 3 13 4 14 5 15