Displaying 20 results from an estimated 900 matches similar to: "Very new - beginners questions"
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
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
2005 Dec 22
3
reading long matrix
Hi,
I'm needing some help 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
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?
Hi, First I should note I am relatively new to R so I would appreciate answers that take this into account.
I am trying to perform an MDS ordination using the function ?metaMDS? of the ?vegan? 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
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
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
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",
2012 Sep 03
1
Scatter plot from tapply output, labels of data
Hei,
i am trying to plot the means 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"
2011 Jul 29
1
Using perm.t.test() upon Matrix/Dataframe columns parted by factor instead of t.test()
Hello dear subscribed Users,
this is my first post, so please forgive me for any inconveniences.
The following problem: I have a dataframe containing a factor column.
For each column i would like to compare means as parted by the factor.
Using the normal t.test function I have already achieved my goal. But i
think, that for my original data, a permutational t.test would be better
suited.
2005 Jul 12
3
adding a factor column based on levels of another factor
Hi R users
Does anyone out there have a better/quicker way of adding a factor column
to a data frame based on levels of another factor?
I have a (large) data frame consisting of records for individual plants,
each represented by a unique ID number. The species of each plant is
indicated in the column "species", which is a factor column with many
different levels (species). There are
2012 Aug 11
1
Ylim problem - plot.correlog, ncf package
Hi,
I'm doing cross-correlation correlograms with the ncf package. I have four
study sites ; four correlograms.
I'd like to get the same y scale for the four of them... only, using
"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
2005 Feb 09
4
subset
Dear all,
I am trying to extract rows from a data.frame based on the
rowSums != 0. I want to preserve rownames in the first column in the subset.
Does anyone know how to extract all species that don't have rowSums equal
to zero? Here it is:
# dataset
x <- data.frame(
species=c("sp.1","sp.2","sp.3","sp.4"),
site1=c(2,3,0,0),
site2=c(0,0,0,0),
2006 Aug 29
1
Bootstraping for groups and subgroups and joing with other table
Dear R-experts,
I have a table with following collumns: State, SamplePlot, Species and BodySize. I sampled bird species at 34 SamplePlots and 5 States (regions) monthly during two years. On each bird record I measured bodysize and identified the species. So I have many records of each species (about 150 species) at each SamplePlot and each Region (State).
Now I would like bootstrap
2011 Feb 06
2
Subsampling out of site*abundance matrix
Hello,
How can I randomly sample individuals within a sites from a site (row) X
species abundance (column) data frame or matrix? As an example, the matrix
"abund2" made below.
##### (sorry, Im a newbie and this is the only way I know to get an example
on here)
abund1 <- c(150, 300, 0, 360, 150, 300, 0, 240, 150, 0, 60,
0, 150, 0, 540, 0, 0, 300, 0, 240, 300, 300,
2012 May 14
2
How to interpret an ANOVA result?
Hello all,
here's a real-world example: I'm measuring a quantity (d) at five
sites (site1 thru site5) on a silicon wafer. There is a clear
site-dependence of the measured value. To find out if this is a
measurement artifact I measured the wafer four times: twice in the
normal position (posN), and twice rotated by 180 degrees (posR). My
data looks like this (full, self-contained code at
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
2018 Apr 18
3
How to replace numeric value in the column contains Text (Factor)?
Hi R user,
Would you mind to help me on how I can change a value in a specific column
and row in a big table? but the column of the table is a factor (not
numeric).
Here is an example. I want to change dat[4:5,3]<-"20" but it generated NA>
do you have any suggestions for me?
dat<-structure(list(Sites = structure(1:5, .Label = c("Site1", "Site2",
2009 Feb 03
1
overlaying plots from a list of data frames
Hello R list,
I have a list of data frames, in the form (dump output for an example
list follows message):
$site1
year data
1 2000 0.03685042
2 2001 0.02583885
6 2005 0.02480015
7 2006 0.03458745
$site2
year data
1 2002 4.071134e-03
2 2003 -4.513524e-08
3 2004 8.336272e-08
4 2005 2.270803e-08
5 2006 1.263597e-02
6 2007 NaN
I would like to plot each
2006 Oct 13
3
multiply two matrixes with the different dimension column by column
Dear all,
I would like to multiply two matrixes with the different dimension column
by column. Let make an example:
If I have two matrixes "X" and "Y"as follow:
X<- matrix(1:12, nrow=4, ncol=3, dimnames=list(c("A","B","C","D"),
c("stage1","stage2","stage3")))
Y<- matrix(1:28, nrow=4, ncol=7,
2018 Apr 18
0
How to replace numeric value in the column contains Text (Factor)?
The simplest would be to convert precip to character and then back to a factor if you really want it to be a factor. This will also remove the levels that no longer exist.
str(dat)
# 'data.frame': 5 obs. of 3 variables:
# $ Sites : Factor w/ 5 levels "Site1","Site2",..: 1 2 3 4 5
# $ temp : num 14 15 12 12.5 17
# $ precip: Factor w/ 5 levels