search for: nicolasg

Displaying 12 results from an estimated 12 matches for "nicolasg".

Did you mean: nicolas
2011 Feb 23
1
Fwd: Re: sum data from data.frame in a matrix
...0 81 0 11 0 0 30 12 95 0 0 Any hints? THANKS!! Nico -------- Original Message -------- Subject: Re: [R] sum data from data.frame in a matrix Date: Wed, 23 Feb 2011 00:10:52 -0800 From: Dennis Murphy <djmuser at gmail.com> To: Nicolas Gutierrez <nicolasg at uw.edu> Hi: ...and a second way, using the reshape2 package: library(reshape2) dcast(df, yloc ~ xloc, value_var = 'yield', fun = sum) yloc 10 11 12 1 10 0 81 0 2 11 0 0 30 3 12 95 0 0 Dennis On Tue, Feb 22, 2011 at 11:30 PM, Nicolas Gutierrez <nicolasg at uw...
2013 Apr 04
3
summing vectors
Hi All, Year Area Q Bin FD I have a large dataset I need to re-structure. It looks something like this: 2000 1 1 5 0 2000 1 1 10 1 2000 1 1 15 23 2000 1 1 20 12 2000 1 1 25 1 2000 2 1 5 1 2000 2 1 10 3 2000 2 1 15 15 2000 2 1 20 11 2000 2 1 25 3 2000 1 2 5 0 2000 1 2 10 1 2000 1 2 15 23 2000 1 2 20 12 2000 1 2 25 1 2000 2 2 5 1 2000 2 2 10 3 2000 2 2 15 15 2000 2 2 20 11
2011 Mar 18
4
subset data frame with condition
Hello, One more question.. I have the data.frame "pop": xloc yloc gonad ind Ene W Area 1 23 20 516.74 1 0.02 20.21 1 2 23 20 1143.20 1 0.02 20.21 1 3 23 20 250.00 1 0.02 20.21 1 4 22 15 251.98 1 0.02 18.69 2 5 22 15 598.08 1 0.02 18.69 2 6 21 19 250.00 1 0.02 20.21 3 7 22 20 251.98 1
2011 Feb 23
1
sum data from data.frame in a matrix
Hi all (again), I have a data frame "pop": xloc yloc yield 1 10 12 95 2 11 10 81 3 12 11 20 4 12 11 10 And I want to get the sum of yield for the cell (pop$xloc, pop$yloc) in a matrix as follows: xloc 10 11 12 10 0 81 0 yloc 11 0 0 30 12 95 0 0 Any ideas? thanks! Nico
2011 Feb 25
1
data.frame operations
Hi All, I've been doing circles with this all morning, although I'm sure there's a simple solution. I have a data.frame "pop" as follows: > pop ind xloc yloc gonad 1 1 5 2 12 2 1 5 4 25 3 1 3 3 30 4 1 5 4 10 5 1 1 4 08 . . . . . 10 1 1 4 11 And I need the following steps: 1. Sum
2011 Feb 28
1
sub setting data.frame
Hi All, I have a data.frame: >pop consumed ind recruits gonad cell 1 516.74 1 0.02 20.21 0.25 2 1143.20 1 0.02 20.21 0.50 3 250.00 1 0.02 20.21 0.25 4 251.98 1 0.02 18.69 0.25 5 598.08 1 0.02 18.69 0.25 6 437.38 1 0.02 18.69 0.25 7 250.00 1 0.02 17.39 0.25 8 250.00 1 0.02 17.39 0.25 9
2013 Apr 04
2
summing vectors/matrices
Hi All, I have a large dataset I need to re-structure. It looks something like this: YearAreaQBinFD20001150200011101200011152320001120122000112512000215120002110 6200021151120002120132000212532000125020001210120001215232000122012200012251 20002251200022103200022151220002220132000222532001…2011 And I need to create different vectors (Bin, FD) summing by year and/or by area; For example, I need
2010 Sep 15
2
how to superimpose 2 matrices of different sizes
Hi All, I?m trying to superimpose (or "add") two matrices: 1. resulting from a table function with frequencies: > U=table(pop$xloc, pop$yloc)) 14 15 16 17 18 19 20 21 22 5 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 9 0 5 10 0 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0 0 0 2.
2011 Mar 19
3
create a matrix with values from data.frame
Hello, I'm trying to create a matrix (95x55) with data from a data.frame pop: xloc yloc go ind Ene totW 1 23 20 516 1 0.02 20.21 2 23 20 1143 1 0.02 20.21 3 23 20 250 1 0.02 20.21 4 22 15 251 1 0.02 18.69 5 22 15 598 1 0.02 18.69 6 21 19 250 1 0.02 20.21 7 22 20 251 1
2011 Feb 27
2
substract 2 data.frames
Hi! I have 2 data.frames: "fish" and "popn": >fish xloc yloc id birth size weight energy gonad 20 15 15 54 -60 107.9 63.0 15952.9 8.0 21 15 15 32 -60 105.1 61.4 15538.8 7.8 91 4 43 96 -60 118.9 69.4 17573.2 8.8 71 32 4 64 -60 121.6 71.0 17976.0 9.0 34 2 64 20 -60 116.2 67.9 17173.0 8.6 95 6 20 58 -60 106.5
2011 Jan 26
1
return object from loop inside a function
Hi All, I have a for loop inside the function and I cannot get UUU to give me an updated grid.dens object when I run the function (it does update when I run just the for loop). Here's a simplified version of my function: UUU=function(pop, grid.dens) { for (i in 1:10){ Food=grid.dens[pop$yloc[i],pop$xloc[i]] #use initial grid.dens values Consumed=(pop$weight[i]*0.25) Left=Food-Consumed
2011 Feb 08
2
delete a row in dataframe w/o changing indexing
Hi All, I'm trying to delete a row from my dataframe "pop" without changing the indexing (column 0) as follows: >pop id birth size xloc yloc weight energy gonad consumed 1 1 36 13 34 43 0 18 0 0 2 2 36 10 39 38 0 18 0 0 3 3 36 10 37 35 0 18 0 0 4 4 36 10 31 25 0