Displaying 20 results from an estimated 3000 matches similar to: "Fwd: Re: sum data from data.frame in a matrix"
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 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 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 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
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 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
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
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 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
2010 Jan 20
1
function curve() (PR#14191)
Full_Name: Georgi Boshnakov
Version: 2.10.1pat
OS: Windows XP
Submission from: (NULL) (130.88.123.205)
When calling programmatically function curve() from package:graphics I
experienced some trouble since it reports
stop("'expr' must be a function or an expression containing 'x'")
even if expr is "expression". Naturally, the user message uses
2011 Aug 08
1
Help on reshape2 data frame rearrangement
Dear help list: I am trying to reshape a data frame from long to wide format and with a reduced variable list using reshape2. The original data frame format is: Site Obs_no LengthSite 1 Obs 1 10Site 1 Obs 2 13Site 1 Obs 3 14.........Site 2 Obs 1 5Site 2 Obs 2 7Site 2 Obs 3 9 Site and Obs_no are factors and Length is a numeric variable. There are 15
2011 Aug 17
1
Symbol Font Baseline, Cairo, Card Symbols
I think I found a bug in the Cairo library, plus weird behavior in
both the Cairo and the normal pdf device. The baseline of the spades
symbol seems to be off. This is easier to show than it is to explain.
The problem does not appear in the normal pdf device, which is why I
am guessing this is a Cairo bug. moreover, I cannot figure out why
three of the card symbols seem to be transparent, but
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
2011 Apr 19
0
doSMP package works better than perfect, at least sometimes.
Some might have noticed that REvolution Computing released the doSMP
package to the general public about a month and a half ago, which allows
multiple cores to be accessed for parallel computation in R. Some of our
physical habitat calculations were taking an extraordinary amount of time
to complete and required over-weekend runs, which prompted our interest in
this package. What follows
2011 Feb 26
1
Transform a dataset from long to wide using reshape2
I seem to be running into the same problem reported in
https://stat.ethz.ch/pipermail/r-help/2010-November/258265.html
I cannot seem to transform a dataset from long to wide using reshape2.
Clearly I am missing something very simple but a look at the manual and the reshape paper in JSS does not suggest anything.
Any advice would be welcome
===========================load
2011 Sep 28
3
Data transformation & cleaning
Hi,
I have a few methodological and implementation questions for ya'll. Thank
you in advance for your help. I have a dataset that reflects people's
preference choices. I want to see if there's any kind of clustering effect
among certain preference choices (e.g. do people who pick choice A also pick
choice D).
I have a data set that has one record per user ID, per preference choice.
2013 Jan 25
3
Bug on xen-create-image
Hi everyone,
I got this error on typing this command xen-create-image. The message say
about a bug.
# xen-create-image --hostname teste01
General Information
--------------------
Hostname : teste01
Distribution : precise
Mirror : http://br.archive.ubuntu.com/ubuntu/
Partitions : Image type : sparse
Memory size : 128Mb
Kernel path :
2006 Mar 02
3
FW: samba as a domain member
whoops, forgot to copy the list on it. sorry.
Well, an update. I can log in to the console using any domain profiles, but, I can not access the exposed home directory through NetBeui (My Network Places/Network Neighborhood).
Also, how should I configure /etc/pam.d/sshd to allow domain users to authenticate and logon through an ssh client (PuTTY?, OpenSSH?)
-----Original Message-----
From:
2013 Jan 25
3
Xen 3 + Eucalyptus 3.1.2
Does anyone know how to install Xen 3 on Ubuntu.
Today, apt-get install xen 4.1, but I think Eucalyptus 3.1.2 only work with
Xen 3.
Thanks
Felipe
--
*--
-- Felipe Oliveira Gutierrez
-- Felipe.o.Gutierrez@gmail.com
-- https://sites.google.com/site/lipe82/Home/diaadia*
_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users