similar to: data.frame transformation

Displaying 20 results from an estimated 100 matches similar to: "data.frame transformation"

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
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
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"
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
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
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 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",
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
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
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) &
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 . . . . . . . . . .
2008 Aug 28
3
drop unused levels in sqldf
Hi, sqldf is a fantastic package, but when the SELECT procedure runs unused levels remain in the output. I tried with the drop function, but without success. Do you have any suggestions? Thanx, Gianandrea data(iris) require(sqldf) base<-sqldf("select * from iris where Species <> 'setosa'") str(base) # Species with 3 levels! -- View this message in context:
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 -
2008 May 02
3
data transformation
Dear all, how can I, with R, transform a presence-absence (0/1) matrix of species occurrences into a presence-only table (3 columns) 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), as given in the below example? Thanks a lot for your help! Christian my dataframe: site lat lon spec1 spec2 spec3 spec4
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
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
2012 May 24
1
package metafor: specify weights?
Dear R-experts, Dear Wolfgang, Weighted model fitting in metafor uses the inverse of the study specific variances as weights. I am wondering if it is possible to specify different weights. In my meta-analysis, there are two types of studies with (intrinsic) differences in their range of sample sizes (which are used to calculate the variances of Fisher's z). I would like to try normalizing
2012 Jan 18
0
makeCluster() function in doSNOW package hangs
Dear R help, I am trying to set up a cluster for parallel computing on a machine running 64-bit windows XP, using the doSNOW package on R 2.14.1. However, the command makeCluster() consistently makes the computer hang. No R processes are started, no CPU consumed, R just becomes unresponsive. ESC still terminates the command, but I cannot start the cluster. There seems to be quite a lot of posts