Displaying 20 results from an estimated 1000 matches similar to: "using the sink() function in a for-look"
2008 May 21
1
split character string in matrix into character vector and numeric vector
Hello,
I've got a matrix consisting of one column with n rows. Each field in
the matrix is filled with a character vector.
I would like to convert this matrix into a character vector containing
the B03_MAH-type entries from the beginning of each row and a data.frame
that contains the numeric data, but I am stuck.
I have tried to use textConnection with sep = " " but since
2009 Jan 07
1
Replace Function (How to replace numbers in a data frame with a specific number)
taxa <- (structure(list(Date = structure(c(4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("2006/04",
"2006/05", "2006/07", "2006/10", "2006/12", "2007/02", "2007/04",
"2007/06", "2007/08", "2007/10", "2007/12", "2008/01"), class =
2008 Mar 09
0
Matrix Row name Compatibility
Hello,
I am trying to preform a comparative analysis using the partial mantel
method. However, i am having trouble creating compatible matrices. I can
create matrices from my numerical data using the 'distance(x, method)'
function from ecodist, but the row/column names are out put as numbers.
While when i create a phyo-distance matrix using 'cophenetic(x)' from APE,
the row/column
2006 May 10
1
ape comparative analysis query
I've been comparing variables among objects (taxa) related by known
trees, using phylogentically independent contrasts in the ape package,
and want to move on to more complex models e.g. by using gls with
appropriate correlation terms. My trees contain lots of (hard)
polytomies and information about ancestors, which I've been including-
creating fully dichotomous trees by using zero branch
2009 Feb 07
3
Re-post data format question (apologies)
Hello all,
I have a *.csv file that looks like this (actual file is orders of magnitude
larger):
Site taxa no.ind
forest LMA 1
forest LCY 1
forest SCO 1
meadow LMA 2
meadow LCY 1
meadow PNT
2009 Apr 06
3
how to subsample all possible combinations of n species taken 1:n at a time?
Hello
I apologise for the length of this entry but please bear with me.
In short:
I need a way of subsampling communities from all possible communities of n
taxa taken 1:n at a time without having to calculate all possible
combinations (because this gives me a memory error - using
combn() or expand.grid() at least). Does anyone know of a function? Or can
you help me edit the
combn
or
2006 Feb 03
0
Re: the dreaded error Before updating scaffolding from new D
Hi Derek,
I was getting this too, with three tables, called taxa,
databases and references
I found I could add an irregular pluralisation for taxa:
Inflector.inflections do |inflect|
inflect.irregular ''taxon'', ''taxa''
end
to the environment.rb, but no amount of modification there would
allow databases and
2011 Apr 06
1
Creating a symmetric contingency table from two vectors with different length of levels in R
Hello,
How can I create a symmetric contingency table from two categorical vectors
having different length of levels?
For example one vector has 98 levels
TotalData1$Taxa.1
[1] "Aconoidasida" "Actinobacteria (class)"
"Actinopterygii" "Alphaproteobacteria"
[5] "Amoebozoa"
2003 Jan 22
1
something wrong when using pspline in clogit?
Dear R users:
I am not entirely convinced that clogit gives me the correct result when I
use pspline() and maybe you could help correct me here.
When I add a constant to my covariate I expect only the intercept to change,
but not the coefficients. This is true (in clogit) when I assume a linear in
the logit model, but the same does not happen when I use pspline().
If I did something similar
2010 Aug 05
2
try-error within for loop
Dear all,
I run a loop wrapped in try(), and for each of the rows where
"try-error" is true I want to fill that row with NA (at the moment it is
omitted). So I would expect to get a dataframe with 1000 rows some of
which would be empty, but instead I get a dataframe with 995 rows. In
this case missing 5 rows were omitted.
Any suggestions?
Thanks,
Olga
----------------
2008 Jan 25
4
Function for translation of a list into a matrix as used by ordination?
Hello.
Does anyone know of an existing function that takes a list in the form of:
Plot1 Species1 Abundance1
Plot1 Species2 Abundance2
Plot2 Species1 Abundance1
Plot2 Species3 Abundance3
.
.
.
PlotN SpeciesN AbundanceN
and translates into a matrix in the form of
Species1 Species2.... SpeciesN
Plot1 Abundance1 Abundance2... AbundanceN
Plot2 Abundance1
2001 Jun 11
0
mult.fig() utility [was "margin text mtext"]
Martin,
I have an objection in principle to anything that has the side-effect of
clobbering something in the global environment, even something as innocuous
looking as "old.par". I certainly object to putting something like that
into a public library, however clever and useful the code might be. It just
is not safe.
As a quick way round this I suggest the following (R only) solution:
2008 Aug 26
1
processing subset lists and then plot(density())
d <- structure(list(Site = structure(c(8L, 12L, 7L, 6L, 11L, 5L, 10L,
4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L,
1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L,
12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L,
11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L,
4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L,
1L, 9L,
2015 Apr 29
0
Formula evaluation, environments and attached packages
Hi Milan,
I expect I may be able to do something about the way the terms are
evaluated, to ensure the evaluation is done in the gnm namespace (while
still ensuring the variables can be found!).
In the meantime, I think the following will work:
Mult <- gnm::Mult
f <- Freq ~ Eye + Hair + Mult(Eye, Hair)
gnm::gnm(f, family=poisson, data=dat)
Hope that helps,
Heather
On Wed, Apr 29, 2015,
2011 Jun 13
0
How to formulate an (effect-modifying) interaction with matching variable in a conditional logistic regression?
Hi,
I would like to see if a matching variable is an effect-modifier in a
conditional logistic regression. Naturally, the matching variable
can't enter directly in the model but as an interaction with terms
that are in.
However, I have problems in formulating the correct model the term
that's already in the model is a factor. I am using treatment
contrasts and the problem is that if I
2014 Sep 04
1
gplot heatmaps: clustering according to rowsidecolors + key.xtickfun
Hi there,
I have two questions about heatmap.2 in gplot.
My input is a simple square matrix with numeric values between 75 and
100 (it is a similarity matrix based on bacterial DNA sequences).
1. I can sort my input matrix into categories with rowsidecolors (in
this case, very conveniently by bacterial taxa). I do a clustering and
reordering of my matrix by Rowv=TRUE (and
2009 Feb 25
0
mefa 3.0-0
Dear R Community,
I am pleased to announce that a new version of the mefa R package is
available at the CRAN.
mefa is a package for multivariate data handling in ecology and
biogeography. It provides object classes to represent the data coded
by samples, taxa and segments (i.e., subpopulations, repeated
measures). It supports easy processing of the data along with
relational data tables for
2009 Feb 25
0
mefa 3.0-0
Dear R Community,
I am pleased to announce that a new version of the mefa R package is
available at the CRAN.
mefa is a package for multivariate data handling in ecology and
biogeography. It provides object classes to represent the data coded
by samples, taxa and segments (i.e., subpopulations, repeated
measures). It supports easy processing of the data along with
relational data tables for
2010 Jan 26
2
tapply and more than one function, with different arguments
Dear R-users,
I am working with R version 2.10.1.
Say I have is a simple function like this:
> my.fun <- function(x, mult) mult*sum(x)
Now, I want to apply this function along with some other (say 'max') to a simple data.frame, like:
> dat <- data.frame(x = 1:4, grp = c("a","a","b","b"))
Ideally, the result would look something like
2016 Apr 02
0
BCa Bootstrap confidence intervals
Dear R-Experts,
Thanks to Prof. Bonnett, I have got an R script working to calculate confidence intervals around the semipartial correlation coefficients.
Now, I would like to calculate BCa bootstrap CIs using the boot library and the boot.ci(results, type="all") function. How could I modify my R script (here below reproducible example) to get the BCa bootstrap CIs ?
CIsemipartcorr