Displaying 20 results from an estimated 400 matches similar to: "Counting/processing a character vector"
2009 Nov 04
2
splitting scientific names into genus, species, and subspecies
I have a list of scientific names in a data set. I would like to split the
names into genus, species and subspecies. Not all names include a
subspecies. Could someone show me how to do this?
My example code is:
a <- matrix(c('genusA speciesA', 10,
'genusB speciesAA', 20,
'genusC speciesAAA subspeciesA', 15,
2003 Aug 11
4
subscripts in lists
I am tying myself in knots over subscripts when applied to lists
I have a list along the lines of:
lis<-list(c("a","b","next","want1","c"),c("d", "next", "want2", "a"))
>From which I want to extract the values following "next" in each
member of the list, i.e. something along the lines of
2011 Mar 03
1
vector("integer", length) : vector size specified is too large
Good day to the R community,
I am interested to run the plot.count() function in the "untb" package.
My script is as follows:-
> library(untb)
> Community1 <-
> structure(c(371,167,119,78,74,53,50,31,28,25,20,19,19,17,13,12,12,10,
> 9,9,8,8,7,7,7,7,6,6,6,6,5,5,5,5,4,4,4,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,
> 1,1,1,1,1,1,1,1), .Dim = 60, .Dimnames =
2008 Dec 09
2
assign()ing within apply
Hello,
I'm trying to convert a character column in several dataframes to lower
case.
###
#
# Sample data and 'spp' column summaries:
# dput(ban.ovs.1993[sample(row.names(ban.ovs.1993), 20), 1:4])
ban.ovs.93 <- structure(list(oplt = c(43L, 43L, 38L, 26L, 35L, 8L, 39L,
1L,
34L, 50L, 10L, 29L, 31L, 24L, 18L, 12L, 27L, 49L, 28L, 51L),
rplt = c(NA_integer_, NA_integer_,
2010 Apr 21
1
Degrees of Freedom Not Allocated to Residuals in Reduced Model
##I am trying to test for fixed factor main effects in an unbalanced mixed effects model but when I fit the reduced model for "mic" factor effects, the extra degrees of freedom are being allocated to a nested term rather than the residuals. The model has inc, mic and spp are independent variables and vial nested within spp. inc and spp are already coded as factors since they were
2005 Oct 04
2
newbie questions - looping through hierarchial datafille
Dear List,
Im new to R - making a transition from SAS. I have a space delimited file
with the following structure. Each line in the datafile is identified by
the first letter.
A = Inventory (Inventory)
X = Stratum (Stratum_no Total Ye=year established)
P = Plot (Plot_no age slope= species)
T = Tree (tree_no frequency)
L = Leader (leader diameter height)
F = Feature (start_height finish_height
2008 Feb 08
1
Can I index a dataframe with a reference from/to a second dataframe?
Hello,
I am unable to figure out how to code a new column in a data frame based
on an existing column that matches a column in a reference data frame,
in a relational-db fashion. I would like this to maintain a minimum set
of reference tables that may be reused over several similar datasets.
Specifically, I have two data frames as listed below, 'Bos' and 'tree.'
For each case in
2016 Jan 27
3
PlaceSafepoints, operand bundles, and RewriteStatepointsForGC
[+CC llvm-dev this time]
Hi,
As discussed in the review thread in http://reviews.llvm.org/D16439,
the future plan around statepoints, deopt bundles, PlaceSafepoints
etc. is to "constant fold" -spp-no-statepoints
and -rs4gc-use-deopt-bundles to true.
We (Azul) have moved to a representation of safepoint polls, deopt
state etc. that enables us to do the above; and at this point I'm
2009 Mar 30
1
Warning messages in Splancs package :: no non-missing arguments to min; returning Inf
Hi,
I would need some help with the splans package in R.
I am using a Shapefile (downloadable at)
http://rapidshare.com/files/215206891/Redlands_Crime.zip
and the following execution code
setwd("C:\\Documents and
Settings\\Dejan\\Desktop\\GIS\\assignment6\\DataSet_Redlands_Crime\\Redlands_Crime")
library(foreign)
library(splancs)
auto_xy<-read.dbf("Auto_theft_98.dbf")
2002 May 28
2
logit regression, test among groups
Dear all:
My logistic regression model includes one qualitative and one quantitative
predictor variable,
aes <- glm(p.a ~ spp * log(light), family=binomial(link=logit)),
where spp is abundance of 3 species and light is subcanopy light
availability varying from 0 1.
I want to test differences among levels of the quantitative variable at a
value of x other than the current log(light)=0.
2011 Nov 25
1
Multiple selection, renaming and saving the results
Dear all,
I have a
big data frame:
str(data1)
'data.frame': 18272 obs. of 11 variables:
$ tag :
int 100001 100002 100003 100005 100007
100008 100009 100011 100012 100014 ...
$ sp :
Factor w/ 18 levels "acassp","acocar",..: 13 5 7 14 14 18 3
11 13 10 ...
$ gx :
num 20 10 35 68 88 63 123 115 137 136
...
$ gy :
num 30 25 24 1 10 40 45 25 23 45 ...
2011 Mar 18
3
exploring dist()
Hello, everybody,
I hope somebody could help me with a dist() function.
I have a data frame of size 2*4087 (col*row), where col corresponds to the
treatment and rows are
species, values are Hellinger distances, I should reconstruct a distance
matrix
with a dist() function. I know that "euclidean" method should be used.
When I type:
dist(dframe,"euclidean")
it gives me a
2007 Feb 23
6
TRUE/FALSE as numeric values
Hello,
I want to select in a column of a dataframe all numbers smaller than a
value x
but when I type in test<-(RSF_EU$AREA<=x) I receiv as answer:
> test
[1] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE
FALSE TRUE TRUE TRUE TRUE TRUE
[18] TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE
TRUE TRUE FALSE TRUE TRUE TRUE
[35] FALSE TRUE
2003 Nov 12
1
"/" operator in model formula
Dear R-help folks,
Can someone guide me to a source where I can learn more about the / operator
in model formulae? I found a reference to it in Venables and Ripley's MASS,
p. 142, where it says, in reference to ANCOVA: "Terms of the form a/x,
where a is a factor, are best thought of as 'separate regression models of
type 1 + x within the levels of a.'..."
This seems
2010 Nov 23
2
How to do a stochastic model in R
Dear all of you,
I would like to get some help from you.
Here I attach you a model, that I would like to be stochastic so I would need each time the value of x changed, the values of parameters (ss, emrg, gf, spp, sr) did too according to a normal distribution, with mean its value and standard deviation given by the parameter name preceded by SDV (In the case of parameter ss, mean is 0.3 and
2011 Mar 31
1
Italicized title from index
Hi all!
I've written a handy script that uses a for loop to allow me to generate a
large number of figures and statistical outputs for a large dataset.
I am using indexing to retrieve a species name for the title of my graphs-
which worked fine. However, I need to italicize these species names.
I originally used the paste function, and had no problems with indexing:
*main=paste("Yield
2007 Oct 26
1
2-way Factorial with random factors
Hello:
I am using R mainly on windows XP, version 2.5. I?m a biologist,
with a medium level statistics background. I have a problem stating a
two-way factorial design where both factors are random. I?m using the
lmer() function implemented in the Matrix package version 0.99.
My design is as follows: Two species were randomly selected from a
total of 4 species. This species are present
2012 Jul 11
3
Subset based on multiple values
I'm stuck on a seemingly simple problem. I'm trying to subset the data by
several numbers and it cuts out half of the rows. Here is the sample code:
test <- as.matrix(c(1,1,1,1,3,3,7,7,7,7))
Count <- tapply(test[,1], test[,1], length) # count for each value
spp <- unique(test[,1])
Count1 <- as.data.frame(cbind(Count,spp))
Max <- max(Count)
Count1$sppMax <-
2007 Nov 19
1
Convert from ppp to spp objects
Hi All!
As a new useR, I am currently working in R 2.5.1 to produce Ripley's L (the linear version of Ripley's K) for a spatial point dataset (originally a ESRI shapefile). I have coerced the data to a ppp object (because I was originally using 'kest' in the spstat package to produced Ripley's K) but I need to convert my spatial data to a spp object to be able to use
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
I am trying to rasterize a SpatialPolygon object by a RasterBrick object.
The documentation of the raster::rasterize function explicitly says this is
allowed. Here's what I am doing
# load the raster package
library("raster")
# create a raster brick object using the example from the brick
function documentation
b <- brick(system.file("external/rlogo.grd",