Displaying 20 results from an estimated 10000 matches similar to: "simple loop(?) analysing subsets"
2003 Nov 13
1
creating a "report" table from a set of lists
I've been trying to figure out how to accomplish the following...
I've got a list (returned from a function) and I would like to "cbind()" the
lists together to create a "cross tab" report or simply bind them together
somehow
the function returns a list that looks like the following:
> all$BM
$species
[1] "BM"
$vbar.nobs
[1] 3
$vbar.sum
[1] 54.05435
2005 Sep 22
3
anova on binomial LMER objects
Dear R users,
I have been having problems getting believable estimates from anova on a
model fit from lmer. I get the impression that F is being greatly
underestimated, as can be seen by running the example I have given below.
First an explanation of what I'm trying to do. I am trying to fit a glmm
with binomial errors to some data. The experiment involves 10
shadehouses, divided between
2010 Aug 13
1
assign multiple variables at once
R Experts,
I would like to create a series of variables without having
to assign a separate line of code for each new variable. My dataframe (DF) contains
two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9 are
abbreviated species codes (full dataframe contains 26 codes). ECRL1 represents the
number of species x in variable ESP1 harvested, and so on through ESP9 and
2017 Oct 20
1
Error messages using nonlinear regression function (nls)
Hi
Keep your messages in the list, you increase your chance to get some answer.
I changed your data to groupedData object (see below), but I did not find any problem in it.
plot(wlg)
gives reasonable picture and I am not such expert to see any problem with data. Seems to me, that something has to be wrong with nlsList function.
> wheat.list <- nlsList(Prop ~ SSlogis(end,Asym, xmid,
2012 Jul 20
4
TukeyHSD not working
Dear r-help members.
I would like to compare species numbers of moths between eight different forests (each sampled for six nights). I would like to do a nested anova to compare species numbers between forests and nights.
For more site specific details I wanted to do a Tukey test (TukeyHSD). Unfortunately this test is not working (message: "nicht anwendbare Methode f?r 'TukeyHSD' auf
2006 Feb 09
1
glmm.admb - bug and possible solution??
Dear Dr Skaug and R users,
just discovered glmm.admb in R, and it seems a very useful tool.
However, I ran into a problem when I compare two models:
m1<-glmm.admb(survival~light*species*damage, random=~1, group="table",
data=bm, family="binomial", link="logit")
m1.1<-glmm.admb(survival~(light+species+damage)^2, random=~1,
group="table", data=bm,
2011 Aug 08
1
Reshape2 sytax
Hi Hadley et all,
I am struggling with reshape2 and melt works and melt_check
(filtered151) seems fine
My cast command was acast (filtered151, Time ~ Species ~ Number)
> melt_check (filtered151)
Using time, Species as id variables
$id
[1] "time" "Species"
$measure
[1] "Number"
When I execute cast the data matrix is in the correct order but the data
2017 Jul 22
1
3-day moving average for block maxima
Dear r-users,
I would like to construct 3-day moving average for block maxima series.
I tried this:
bmthree <- lapply(split(dt, dt$Year), function(x) max(sapply(1:(nrow(x)-2),
function(i) with(x, mean(Amount[i:(i+2)],na.rm=TRUE)))))
bmthree
and got the following output.
$`1971`
[1] 70.81667
$`1972`
[1] 68.94553
$`1973`
[1] 102.7236
$`1974`
[1] 73.6625
$`1975`
[1]
2016 Apr 18
3
Indicator Species analysis; trouble with multipatt
Hello,
*Error in tx %*% comb : non-conformable arguments*
Suggestions greatly appreciated. I am a beginner and this is my first time
posting.
I would like to get the summary for indicator species analysis, using
package indicspecies with multipatt. I am getting errors, I believe, do to
my data organization. After reorganizing and reorganizing, nothing has
helped.
> data<-
2011 Jan 27
2
help for a loop procedure
Hello everybody!
I’m trying to define the optimal number of surveys to detect the highest
number of species within a monitoring season/session.
To do this I want to run all the possible combinations between a set of
samples and to calculate the total number of species for each combination of
2, 3, 4 …n samples events, so that at the end I will be able to define which
is the lowest number of
2010 Apr 05
4
NMDS Ordination Graphics Problem
Dr. Stevens,
Hi, my name is Trey Scott, and I'm a grad student of Brian McCarthy's. He
referred me to you because of your expertise in handling complex R problems.
We were hoping you could help us solve a nagging problem that is prohibiting
me from producing graphicl output.
Here is a simple mock-up of the matrix I'm using
a b c d e f
1i 1 4
2016 Apr 19
0
Indicator Species analysis; trouble with multipatt
Hi Ansely,
As Jim points out we really need some sample data to go with the code.
Have a look at ?dput which is the best way to supply sample data here or have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html for some general suggestions on asking questions here---including discussions of using
2010 Feb 03
1
Calculating subsets "on the fly" with ddply
Hi,
[I sent this to the plyr mailing list (late) last night, but it seems
to be lost in the moderation queue, so here's a shot to the broadeR
community]
Apologies in advance for being more verbose than necessary, but I'm
not even sure how to ask this question in the context of plyr, so ...
here goes.
As meaningless as this might be to do with the `iris` data, the spirit
of it is what
2012 Oct 25
5
trying ti use a function in aggregate
Hi -I am using R v 2.13.0. I am trying to use the aggregate function to
calculate the percent at length for each Trip_id and CommonName. Here is a
small subset of the data.
Trip_id Vessel CommonName Length Count
1 230 Sunlight Shad,American 19 1
2 230 Sunlight Shad,American 20 1
3 230 Sunlight Shad,American 21
2008 Dec 09
2
Need help optimizing/vectorizing nested loops
Hi,
I'm analyzing a large number of large simulation datasets, and I've
isolated one of the bottlenecks. Any help in speeding it up would be
appreciated.
`dat` is a dataframe of samples from a regular grid. The first two
columns are the spatial coordinates of the samples, the remaining 20
columns are the abundances of species in each cell. I need to calculate
the species richness in
2012 Apr 06
4
Legend based on levels of a variable
I have a bivariate plot of axis2 against axis1 (data below). I would like
to use different size, type and color for points in the plot for the point
coming from different region. For some reasons, I cannot get it done. Below
is my code.
col <- rep(c("blue", "red", "darkgreen"), c(16, 16, 16))
## Choose different size of points
cex <- rep(c(1, 1.2, 1), c(16, 16,
2011 Jan 06
1
Multiple subsets of data
Dear List,
I have a data frame called trait with roughly 800 species in, each species have 15 columns of information:
Species 1 2 3 etc..
a t y h
b f j u
c r y u
etc..
I then have another data frame called com with the composition of species in each region, there are 506 different communities:
community species
NA1102 a
NA1102 c
NA0402 b
NA0402 c
AT1302 a
AT1302 b
etc..
What
2013 Mar 26
2
Problem with nested for-loop
Hello,
I'm working on a problem using nested for-loops and I don't know if it's a
problem with the order of the loops or something within the loop so any
help with the problem would be appreciated. To briefly set up the problem.
I have 259 trees (from 11 different species, of unequal count for each
species) of which I am trying to predict biomass. For each tree species I
have 10000
2012 May 10
6
averaging two tables (rows with columns)
Hi R user,I am struggling to figure out on how I can calculate the average from the two tables in R. Any one can help me? really your help would be grateful- I am spending so much time to figure it out. It should not be so hard, I think.
I have very big data but I have created a hypothetical data for simplification.
for example
I have : table 1
table 1: species occurance data
2005 Jun 22
1
legend
I color some area grey with polygon() (with a red border) and then I
want to have the dashed red border in the legend as well. How do I
manage it?
And I want to mix (latex) expressions with text in my legend.
Just execute my lines below and you know want I mean. Or pass by at
http://de.wikipedia.org/wiki/Bild:GBM.png to see the picture online.
Thomas
bm <- function(n=500, from=0, to=1) {