Displaying 20 results from an estimated 8000 matches similar to: "data.frame operations"
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 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 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 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 23
1
Fwd: Re: sum data from data.frame in a matrix
Hi Dennis,
Thanks for your quick response and sorry for not being clear. That
helped, but I need an actual matrix of e.g., 12 x 12 and those functions
give me a matrix with only the "filled" locations. I need a 12 by 12
matrix with sums (0 if there's not data and the actual sum where there
is) as follows:
1 2 3 4 5 6 7 8 9 10 11 12
1 0 0 0 . . . . . . 0 0 0
2 0 0 0 .
3 0
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
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 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 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 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
2007 Jun 11
1
Gini coefficient in R
If I use the Ineq library and the Gini function in this way:
>Gini(c(100,0,0,0))
I obtain the result 0.75 instead of 1 (that is the perfect inequality).
I think Gini's formula in Ineq is based on a formula as reported here:
http://mathworld.wolfram.com/GiniCoefficient.html
but in the case of perfect inequality:
x_1=.......=x_n-1 =0
x_n>0
these formula are equal to 1 - 1/n, not to
2018 Feb 27
1
Help
Dear
I hope you are wery well when read this e-mail.My name is Firas ALSHAWY and
I am a Phd student in the high Institute of marine research - tishreen
university- Syria
I would like to want some help my in my research, I have data ( length -
weight - gonad weight - fishing mortality - natural mortality - the number
of fish-temperature of water, maximum age ) , I would like to use the
package (
2010 Jul 10
3
a very particular plot
Hi all,
Thanks for the really great help I've received on this board in the past.
I have a very particular graph that I'm trying to plot, and I'm not really
sure how to do it. I think I should be able to use ggplot for this, but I'm
not really sure how.
I have a data.frame which contains fifty sub frames containing one hundred
data points each.
I can do a histogram of each of
2011 Jan 17
2
Summing data frame columns on identical data
Dear all,
I have 9 data frames, and I'm simply trying to sum the values of column 3 (on a row-by-row basis). However, there are a slightly different number of rows in each data frame, so I'm receiving the following error: "Error in Ops.data.frame(mrunoff_207101[3], mrunoff_207102[3]) :
? + only defined for equally-sized data frames".
Here is what I'm attempting to do:
2007 Apr 05
7
Problems using GFS2 and clustered dovecot
I am trying to use dovecot. I've got a GFS2 shared volume on two servers
with dovecot running on both. On one server at a time, it works.
The test I am trying is to attach two mail programs (MUA) via IMAPS
(Thunderbird and Evolution as it happens). I've attached one mail
program to each IMAPS server. I am trying to move emails around in one
program (from folder to folder), and then
2011 Jul 27
2
Writing a summary file in R
Hello,
I have an input file:
http://r.789695.n4.nabble.com/file/n3700031/testOut.txt testOut.txt
where col 1 is chromosome, column2 is start of region, column 3 is end of
region, column 4 and 5 is base position, column 6 is total reads, column 7
is methylation data, and column 8 is the strand.
I would like a summary output file such as:
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
2012 Dec 11
2
lattice question: how to change the dot on boxplot to line
Hi,
How does one change the dot for the median in a boxplot drawn using
lattice? I have been looking at
> names(trellis.par.get())
[1] "grid.pars" "fontsize" "background"
[4] "panel.background" "clip" "add.line"
[7] "add.text" "plot.polygon"
2009 Sep 19
1
matrix operations on grobs and grid units
Dear list,
As a minimal test of a more complex grid layout, I'm trying to find a
clean and efficient way to arrange text grobs in a rectangular layout.
The labels may be expressions, or text with a fontsize different of
the default, which means that the cell sizes should probably be
calculated using grobWidth() and grobHeight() as opposed to simpler
stringWidth() and stringHeight().