similar to: aggregate question...

Displaying 20 results from an estimated 1000 matches similar to: "aggregate question..."

2003 Nov 16
2
prevent conversion to factors in aggregate?
I've been trying to figure out how to prevent a column that is the result of an aggregate function call so that I can use it in further calculations. For example, I would like to aggregate the expf for the data.frame by sp (character) and dbh (double d=rounded to integer) using the command: > st2 <- aggregate( ntrs$expf, by=list(sp=ntrs$sp,dbh=ntrs$dbh), sum ) > st2$expf <- st2$x
2003 Nov 13
1
creating a "report" table from a set of lists
I've been trying to figure out how to accomplish the following... I've got a list (returned from a function) and I would like to "cbind()" the lists together to create a "cross tab" report or simply bind them together somehow the function returns a list that looks like the following: > all$BM $species [1] "BM" $vbar.nobs [1] 3 $vbar.sum [1] 54.05435
2004 Nov 29
1
data is getting corrupted
I've been attempting to perform some analysis on a model that was interfaced with R (R calls a library that takes SEXPs and converts the data frames into the internal structures of data), and I notice that for small data.frames the vectors don't get corrupt (n<200-ish). When I pass in larger data.frames, the vectors will become corrupt. I've been PROTECTING the heck out of
2001 Dec 08
1
plotting values "by"
I would like to produce a set of values, on the same chart, from an sql table that is structured like... species dbh ht expf DF 1.2 8.9 10.0 DF 2.4 17.3 12.4342 DF 3.1 20.9 56.76 PP 2.3 16.9 100.0 PP 12.8 97.3 40.3 PP 8.2 63.0 98.34 . . . SS blah, blah, blah... is it possible to, using a single command in the plot command to plot the different groups on the same plot or will I have to iterate
2003 Nov 06
2
created data doesn't remain when split...
I've been trying to figure out why the following is happening.... I've got some data I'll load in from a file... rm(list=ls(all=TRUE)) trees <- read.table( "c:/cruisepak/data.txt", header=T) trees$ct <- 1 And when I create some temp variable, then split the data to perform further processing, the additional column doesn't maintain the data correctly.... mtrees
2003 Nov 18
1
data.frame subset?
Can someone tell me why this is since I can't seem to find an explination in the docs or FAQ for this. Since there are no "BM" in the mtrs data.frame, but only in the "parent" data.frame (trees), I'm assuming the subset data.frame is still associated with the original. Is that correct and how would I create a completly separate data.frame since I'll be using by,
2006 Mar 09
0
variable '%s' was fitted with class... in predict.nls()
I've tried to predict the values from a new data.frame using the nls.predict function and keep getting the error message: Error in if (sum(wrong) == 1) stop(gettextf("variable '%s' was fitted with class \"%s\" but class \"%s\" was supplied", : missing value where TRUE/FALSE needed I first thought that it was becuase there may have been something
2002 Feb 28
1
trying to build matrix for tests...
Okay, I stumped. I'm trying to build a matrix or data.frame that consists of values by group. For example, resid, group 574 0.536196370873122 E 575 0.93191093696265 E 576 -1.27116094894117 A 577 -1.05159666055027 A 578 0.398273458301184 D 579 0.586373126102573 E 580 0.806575304513802 E 581 0.897258393118338 E 582 0.342393324256838 D 583 0.781245511773227 E I
2011 Jan 31
1
httpd-access.log parsing and graph construction.
R gurus: I'm thinking about using R for website traffic analysis but didn't find anything in my web searches specific to R. If I have the webpages (simple example would contain something like three (3) static pages with a couple of links each) and parse the apache access log file (httpd-access.log), then I can populate the graph representing the website and perform whatever analysis I
2003 Dec 02
3
check WARNING...
I've been developing a package and have been getting the following warning when running the check command: * checking S3 generic/method consistency ... WARNING plot: function(x, ...) plot.summaries: function(trees, sp) * checking for replacement functions with final arg not named 'value' ... OK * checking Rd files ... OK ...blah, blah, blah... * checking examples ... OK *
2004 Oct 12
2
constrained optimization using nlm/optim?
I'm looking for an example of a simple R script that impliments a contrained nonlinear function using nlm or optim. I'm not exactly sure how to impliment the constraints within the objective function that is passed to nlm/optim. obj.func <- function( p ) { x(p) <- unconstrained obj function value if( constraint1 > something ) { obj.func <- x(p) } else {
2004 Oct 08
0
constrained opt with lagrange multiplier example?
I'm curious to find out if there is an example of R code for optimization of two variable function, with contraints, using lagrange multiplier (using optim/nlm?). I have a problem that contains one discrete variable, but need a simple problem/example to start with. I haven't been able to find any examples and thought I should ask here before I plunged into writing a few miles of R code.
2004 Nov 24
0
coplot =? gannt chart + bargraph
I would like to display some results from simulations in the form of a Gantt chart (progress) with a barchart (production) of another variable below (something very similar to coplot charts). I'm not sure if I should attempt to build this from scratch (using grid or some of the basic graphics features) or if there's a similar feature in one of the existing packages. I need to take the
2002 Feb 12
1
getting quotes out of matrix?
I've trying to check for model bias. It was recommended to me that I should break the residuals into n groups and test to see if the mean is different from zero. What is the best way to generate the groups. I've generated a matrix that contains the residuals and groups, but the values all have quotes around them. 1) how do I get rid of the quotes? 2) is this an acceptable method for
2012 Jun 22
1
Vignettes are not being (re)built.
I'm adding a couple of vignettes to an existing package. When I make a change to the sweave file, and run the check command, c:\conifers\trunk>R CMD check rconifers I get the following message(s) in the 00check.log file: * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... WARNING Package vignette(s) without corresponding PDF:
2005 May 23
6
colors and palettes and things...
After trying to find if there was a color picker in the FAQs and the help, I thought I would send a post here. I was overwhelmed with all the wonderful color choices R has predefined (discovered after typing in colors()) but can't figure out what they all (by name) look like. Is there a color picker or some other method to display all those colors next to the name? I think I can put together
2004 May 12
1
summary table newbie question
I've got a newbie question and I got a little lost in the "table helps". I've got a data.frame I would like to summarize as a (and pardon for the lack of correct vernacular) data collection matrix. My data looks like, stand siteindex age acres pct.acres 1 232 116 45 8477.3105 0.56159458 2 234 121 25 11120.1530 0.73667441 3 235 132 25
2004 Feb 20
1
Sweave not found from MikTeX?
I've been working on a LaTeX document that contains Sweave code and cannot get MikTeX to find the Sweave.sty file. I've added the c:\rw1081\share\texmf path in the MikTeX roots (I've ven added the path in the environment variables ) but to no avail. Is there a trick to getting Sweave installed correctly when using MikTeX on Windows XP? Do I need to move/copy the Sweave.sty file to the
2012 Jan 11
2
package DESCRIPTION file and CRAN Task View entries?
I'm in the middle of a long overdue package update, and after seeing the CRAN Task Views I thought there would be an entry, in the DESCRIPTIONS file, for that entry that appears on the package webpage. For example, http://cran.case.edu/web/packages/vegan/index.html Since it's been some time since I've updated the package, I did a little reading (R-exts.pdf) and web searching and
2004 Jan 15
2
plotting predicted values (lines) over data?
I've been trying to plot the predicted values, as a line, over the data for a simple nonlinear fit with the following commands: plot( hg ~ ht ) ... define some function hg ~ ht + junk ... ... blah, blah, obtain parameter estimates and predicted values, blah... ... then... lines( sort( $predicted ) ~ sort( ht ) ) which results in a line that isn't smooth (which I knew would happen).