similar to: About matrix manipulation

Displaying 20 results from an estimated 30000 matches similar to: "About matrix manipulation"

2012 Mar 30
1
removing NA from multidmension arrays
Hi: I'm having some difficulty properly subscripting a function to remove complete NA rows from a R array object. Could someone please suggest how best to script this out? Data structure: X is an array with 3 dimensions (replicates, Species, Sites) replicates: 1 to 6 but ragged...not all sites equal ,,Site1 Sp1 Sp2 Sp3... Sp50 1 5 4 3 2 2 3 0 0 1 3 NA NA NA NA 4 NA NA NA NA 5 NA
2005 Nov 27
4
Counting the occurence of each unique "charecter string"
LS, I would really like to know how to count the frequency/occurrence of chachters inside a dataset. I am working with extreemly large datasets of forest inventory data with a large variety of different species inside it. Each row inside the dataframe represents one individual tree and the simplified dataframe looks something like this: num species dbh 1 sp1
2005 Nov 27
4
Counting the occurence of each unique "charecter string"
LS, I would really like to know how to count the frequency/occurrence of chachters inside a dataset. I am working with extreemly large datasets of forest inventory data with a large variety of different species inside it. Each row inside the dataframe represents one individual tree and the simplified dataframe looks something like this: num species dbh 1 sp1
2008 Jul 22
1
data transformation
Dear all, how can I, with R, transform a presence-only table (with the names of the species (1st column), the lat information of the sites (2nd column) and the lon information of the sites (3rd column)) into a presence-absence (0/1) matrix of species occurrences across sites, as given in the below example? Thanks a lot for your help! Christian My initial table: species lat lon sp1 10 10
2009 Jan 07
4
Another newbie question
Problem: I have a data frame with 1s and 0s denoting presence/absence of species (columns) for particular plot measurements (rows). What I want to do is make a new column whose entries for each row is a list of the column names in which a species is present (ie. for row one its entry might read: "sp1","sp2", etc.). I've tried various functions etc. but can't seem to
2009 Jul 27
1
Cross-validating two matrices
Hello, I am trying to help a colleague with an R problem (see below) to whit I can only generate a very inelegant solution. Any advice would be welcome. Thanks, Brian If you have two matrices, say a species by trait matrix (Matrix 1 below) and a plot by species matrix (Matrix 2 below), is there a straightforward way to prune one matrix so that the species list matches those in a
2004 Dec 06
1
using subset
Hi, I have doubts in using subset command. I have a list of, lets say, 15 species and I want to make a subset with only 2 of them. I??m the command data2 <- subset(data1, species=="sp1"|species=="sp2") Nevertheless, when I ask for the summary (summary(data2)) the others species names still apearing. Also I tried data2<-data1(data1$species %in%
2007 May 29
1
rgl.postscript
Hi, I am having an issue when creating a postscript file from RGL window. It seems to cut off some of the axis labels. Here is the code I am using. I created a 3D plot using RGL_0.71 with R 2.5 on Windows XP. z1<-c(5,4,1,4.5,2,3,2,1,1) z2<-c(6,8,7,7.5,5,3.5,4,1,1) z3<-c(3,2,4,7,3,4.5,6,2,3) x1<-seq(1,9) x2<-seq(1,9) x3<-seq(10,18) y1<-seq(8,0) y2<--1*y1
2006 May 23
2
transpose dataset to PC-ORD?
Hello: I need to take a species-sample matrix and transpose it to the format used by PC-ORD for analysis. Unfortunately, the number of species is very large (>5000), and so this operation cannot be performed simply in an application like Excel, which has a 255 column limit. So, I wrote relatively simple code in R that I hoped would do this (appended below). But there are glitches. The
2006 Sep 17
2
Excluding columns from dataframe and selecting row records
Dear R-friends, I have to simple questions. First I would like to exclude some columns from a dataframe and after I need select rows that satisfy some conditions. My data frame looks like Region Species Bodysize Weigth Age Africa Sp1 10.2 20 2 Africa Sp2 12.2 12 2 Africa Sp3 15.3 18 3 Africa Sp4 11.5 40 4 Brazil Sp1 10.2 40 3 Brazil Sp2 22.2 32 2 Brazil Sp3 12.3
2005 Feb 03
1
Efficient selection and alteration of dataframe records
Hi All, I am writing a simulation that examines the effects of species extinctions on ecological communties by sequentially removing individuals of a given species (sometimes using weighted probabilities) and replacing the lost individuals with species identities randomly sampled from the remaining individuals. Thus I use two dataframes. One contains all the individuals and their species
2011 May 23
2
Linear regression - several response variables vs few ind variables
Hi all, I need to run several simple linear regressions at once, using the following data. Response variables: Bird species (sp 1, sp2, sp3...spn). Independent variable: Natprop - proportion of natural area. covarate: Effort = hours). One single linear regression would be: lmSp1 <- lm(sp1~ natprop + effort). However, I need to run this linear regression for all bird species that I have
2005 Jul 13
1
Name for factor's levels with contr.sum
Good morning, I used in R contr.sum for the contrast in a lme model: > options(contrasts=c("contr.sum","contr.poly")) > Septo5.lme<-lme(Septo~Variete+DateSemi,Data4.Iso,random=~1|LieuDit) > intervals(Septo5.lme)$fixed lower est. upper (Intercept) 17.0644033 23.106110 29.147816 Variete1 9.5819873 17.335324 25.088661 Variete2 -3.3794907 6.816101 17.011692 Variete3
2004 Jun 14
1
Piecharts in a graph
Dear R-Community. I am trying show pie charts on a graph. To be precise, I have series of catch calues by species by geographic (5 deg by 5 deg) regions. I want to draw circles (actually pie charts showing the proportion of the catch in each area) so that I have a graph of catch by species by geographic area! I know there is the < symbols(dat$lon,dat$lat,circles = dat$sp1, add=TRUE) > but
2007 Apr 01
4
Abundance data ordination in R
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070401/33921c2a/attachment.pl
2005 Oct 04
2
Joining Dataframes
I am attempting to join several dataframes that summarize sampling effort for different 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
2006 Sep 26
1
How to "Pack" a matrix
Hello, Suppose I have a matrix a where a= sp1 sp2 sp3 sp4 sp5 sp6 site1 1 0 1 1 0 1 site2 1 0 1 1 0 1 site3 1 1 1 1 1 1 site4 0 1 1 1 0 1 site5 0 0 1 0 0 1 site6 0 0 1 0 1 0 And I want to pack that matrix so that the upper left corner contains most of the ones and the bottom right corner contains most of the zeros so that matrix b is b= sp3 sp6 sp4 sp1 sp2 sp5 site1 1 1 1 1 0 0 site2
2013 May 01
1
help understanding hierarchical clustering
Hi All, i've problem to understand how to work with R to generate a hierarchical clustering my data are in a csv and looks like : idcode,count,temp,sal,depth_m,subs 16001,136,4.308,32.828,63.46,47 16001,109,4.31,32.829,63.09,49 16001,107,4.302,32.822,62.54,47 16001,87,4.318,32.834,62.54,48 16002,82,4.312,32.832,63.28,49 16002,77,4.325,32.828,65.65,46 16002,77,4.302,32.821,62.36,47
2013 Sep 27
3
Compare species presence and absence between sites
Dear List, I want to compare the presence and absence of bird species based on the sites in a matrix. The matrix has 5 rows for Island A, B, C, D, and E. It has 100 columns for bird species D001-D100. In each cell of the matrix, the presence-absence of bird species will be recorded as 1 or 0. (For example, if species D001 is found on Island D, the matrix cell of species D001 and Island D
2008 Jan 31
1
random forest and vegetation data
Hi there, I am an environmental studies masters student trying to get my thesis out the door. I am also newbie at trees in general, but I like what I see in the literature about the random forest algorithm. I think I get the general gist of things, but even after reading stuff I?m unclear about how I could be getting the results I?m seeing. I obviously am missing something about how the split