search for: species1

Displaying 16 results from an estimated 16 matches for "species1".

Did you mean: species
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) & order(Sepal.Length, rev(sort(Species1))),]) ##...
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 Abundan...
2008 Jan 30
2
data.frame transformation
Dear all, maybe somebody can provide some help for this problem: Example: I've got the following dataframe "data": grid.id<-c(1:4) lat<-c(10,12,13,15) species1<-c(0,0,0,1) species2<-c(1,1,0,0) species3<-c(1,1,1,1) data<-data.frame(cbind(grid.id,lat,species1,species2,species3)) How can I, out of "data" make a new dataframe, where the cells of value "1" in the species columns ("species1" to "species3") a...
2005 Dec 22
3
reading long matrix
...lp finding a function to read a large text file into an array in R. The data are essentially presence / absence / na data for many species and come as a grid with each species name (after two spaces) at the beginning of the matrix defining the map for that species. An excerpt could therefore be: SPECIES1 999001099 900110109 011101000 901100101 110100019 901110019 SPECIES2 999000099 900110119 011101100 901010101 110000019 900000019 SPECIES3 999001099 900100109 011100010 901100100 110100019 901110019 where 9 is actually na, 0 is absence and 1 presence. The final array I want to create should h...
2005 Oct 04
2
Joining Dataframes
...erent samples into one large data.frame/table. I have looked at the merge command, but have not been clever enough to figure out how to get it to do what I want. A simplified example of what I am trying to do: The dataframes I have look like this (they were generated using the table command) species1.effort site1 site2 site3 date1 5 5 5 date2 4 5 5 date3 4 5 5 species2.effort site1 site2 site3 date1 7 8 6 date3 8 7 8 date4 8 8 8 I would like to join these in...
2012 Sep 03
1
Scatter plot from tapply output, labels of data
...of two variables (d13C and d15N), by 2 grouping factors (Species and Year) that i obtained by the function tapply. I would like to plot with different colours according to the Year and show the "Species" as data labels. My data looks like this: Species d13C d13N Year "Species1" 14,4 11.5 2009 "Species2" ... ... .... >Nmean<-tapply(d15N,list(Year,Species),mean) >Cmean<-tapply(d13C,list(Year,Species),mean) ##works fine, returns something like this Species1 Species2 Species3 2009 20...
2010 Nov 05
3
table with values as dots in increasing sizes
I was just thinking of a way to present data and if it is possible in R. I have a data frame that looks as follows (this is just mockup data). df location,"species1","species2","species3","species4","species5" "loc1",0.44,0.28,0.37,-0.24,0.41 "loc2",0.54,0.62,0.34,0.52,0.71 "loc3",-0.33,0.75,-0.34,0.48,0.61 location is a factor while all the species are numerical vectors. I would like...
2007 Aug 13
3
Very new - beginners questions
Dear all, I have 4 sites and want to determine how different they are from each other. For this I have decided to use R though it seems a bit daunting to learn. I have read data in from a CSV the structure is : Species1 Species2 Species3 Site1 4 4 7 Site2 3 1 0 Site3 0 99 6 Site4 75 3 33 There are many more species than shown above this is just an example. Here are the questions. How do I read one row of data so as to load site2 into a variable called site2? Once I plot a graph using ordiplot...
2012 Aug 11
1
Ylim problem - plot.correlog, ncf package
..."ylim=c(-1,1)" does not change the y scale never and I don't know why. I tried with plot() too. Is there another option to change the ylim in plots ? Example with only one correlog (all work but ylim). They all have the same form. cross_calf2 <- correlog(calf2$X,calf2$Y, calf2$species1, calf2$species2, increment=2) plot.correlog(cross_calf2,ylim=c(-1,1)) Thanks ! Pyh. -- View this message in context: http://r.789695.n4.nabble.com/Ylim-problem-plot-correlog-ncf-package-tp4640044.html Sent from the R help mailing list archive at Nabble.com.
2005 Jul 12
3
adding a factor column based on levels of another factor
...sp12 1.1 0.9 5 8 8 sp3 3.4 3.6 2 I would like to add a factor column to this data frame, indicating to which group each individual belongs. All individuals of the same species will belong to the same group. Is there a quick way of saying "for all instances of species1, give the value 5, for all instances of species2, give the value 4, etc" (where 5 and 4 are levels of a factor)? The only way I can think of doing it is to split the data frame by species, then add a column to each subset showing the group, then re-join all the subsets. This seems clumsy and...
2011 Jul 29
1
Using perm.t.test() upon Matrix/Dataframe columns parted by factor instead of t.test()
...p parting in the formular expression I am not able to do this with perm.t.test() from deducer. Have fun with this trivial undergraduate problem. Code: c(rep("A", 5), rep("B", 5))->Faktor matrix(rnorm(100, mean=20, sd=4), nrow=10, ncol=10)->M colnames(M) <- c("species1","species2", "species3","species4","species5","species6","species7","species8","species9", "species10") ###Conventional T-Test to test for differences of each species per factor lapply( M, function...
2011 Nov 24
4
I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?
...an? package. I want to ordinate species according to a set of functional traits. ?Species? here refers to ?sites? in traditional vegetation analyses while ?traits? here correspond to ?species? in such analyses. My data looks like this: Trait1 Trait2 Trait3 Trait4 Trait5 Trait? Species1 228.44 16.56 1.66 13.22 1 short Species2 150.55 28.07 0.41 0.60 1 mid Species3 NA 25.89 NA 0.55 0 large Species4 147.70 17.65 0.42 1.12 NA large Species? 132.68 NA 1.28 2.75 0 short Because the traits have differe...
2005 Nov 03
4
merging dataframes
Dear List, I often have to merge two or more data frames containing unique row names but with some columns (names) common to the two data frames and some columns not common. This toy example will explain the kind of setup I am talking about: mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5)) mat2 <- as.data.frame(matrix(rnorm(20), nrow = 4)) rownames(mat1) <- paste("site",
2011 Jul 07
0
CAPdiscrim error in BiodiversityR
Hello, I having trouble running the CAPdiscrim function located in biodiversityR. My data tables are as follows: community data frame (called "spdata") Species1... Speciesn site1.. site2.. siten with abundance data as values. Site names are row names. and environmental data (called "envdata") year elevation site1... site2... siten my command lines are as follows: dists = vegdist(spdata, method ="bray") capmodel =...
2011 May 29
1
constructing nxn matrices involving calculations& conditions based on other tables
Dear R-users, I am having trouble constructing nxn matrices involving calculations& conditions based on other tables. Below I describe a simple example of what I am trying to do: Given the Table A (n x m): Species1 Species2 X A1,1 A1,2 Y A2,1 A2,2 Z A3,1 A3,2 I want to create a matrix M (n xn) X Y Z X - M1,2 M1,3 Y M2,1 - M2,3 Z M3,1 M3,2 - Where M1,2 is equal to the number of common species between X & Y So if: A1,1 = 5; A1,2 =0 A2, 1 = 1; A2,2 =3 Then M1,2 = 1...
2007 Oct 05
0
use of specaccum in routine procedure
Dear list members, I have a data.frame so shaped: Sector Quadrants Plot Sic Time Species1 Species2 Species3 .. Species-n 1 1 1 1 5 0 0 1 . 0 2 1 1 1 12 1 1 1 . 0 3 1 1 1 34 0 1 0 . 0 4 1 1 1 23 1 1 0 . 0 5 2 1 1 22 1 1 1 . 1 6 2 1 1 10 1 1 1 . 1 7 2 1 1 2 1 0 0 . 0 8 2 1 1 2 0 0 1 . 0 9 3 1 1 12 0 0 0 . 1 . . . . . . . ....