[R] Convert the output of by() to a data frame

2011-02-07 Thread Al Roark
I'd like to summarize several variables in a data frame, for multiple groups, and store the results in a data.frame. To do so, I'm using by(). For example: df<-data.frame(a=1:10,b=11:20,c=21:30,grp1=c("x","y"),grp2=c("x","y"),grp3=c("x","y")) dfsum<-by(df[c("a","b","c")], df[c("grp1","grp2","grp

[R] Repeating the same calculation across multiple pairs of variables

2011-03-04 Thread Al Roark
Hi all, I frequently encounter datasets that require me to repeat the same calculation across many variables. For example, given a dataset with total employment variables and manufacturing employment variables for the years 1990-2010, I might have to calculate manufacturing's share of total e

[R] Preferred way to create bubble plots?

2011-03-07 Thread Al Roark
I have to create a number of bubble plots, and am wondering what methods folks prefer for this task. I've been experimenting with the symbols() function, with text() to provide plot labels. Any opinions on the relative merits of this method versus others? One criterion would be the ability to

[R] How does the cex parameter scale circles?

2011-03-09 Thread Al Roark
I'm wondering how the cex parameter is used to scale circles (i.e. does it scale the radius, diameter, area, circumference, etc.?). In my case I'm using lattice with filled circles (pch=19). Based on example, it looks like R scales the radius of the circle: library(lattice) dta<-data.frame(x

[R] Adjust the distance between tick mark labels and axis

2011-03-10 Thread Al Roark
Hi all: I've been trying to figure out a way to move the tick mark labels in my lattice plots closer to the the axes. I've tinkered with a lot of the "buffer" parameters (those listed by trellis.par.get()), but haven't had any luck. Any ideas? Cheers.

[R] grImport/ghostscript problems

2011-03-27 Thread Al Roark
Hi All: I've been struggling for a while trying to get grImport up and running. I'm on a Windows 7 (home premium 64 bit) machine running R-2.12.2 along with GPL Ghostscript 9.01. I've set my Windows PATH variable to point to the Ghostscript \bin and \lib directories, and I've created the R_GS

Re: [R] grImport/ghostscript problems

2011-03-27 Thread Al Roark
Paul Murrell auckland.ac.nz> writes: > > Hi > > On 28/03/2011 8:13 a.m., Al Roark wrote: > > > > Hi All: I've been struggling for a while trying to get grImport up > > and running. I'm on a Windows 7 (home premium 64 bit) machine > > running R

[R] CairoPDF, Fonts, and Windows 7

2011-04-16 Thread Al Roark
Hi All: I have some basic questions about Cairo graphics engine. I'm trying to use the Cairo package to produce PDF output, mainly because I perceive it to be easy to use with a wide variety of fonts. But right now, I'm stuck trying to figure out what fonts are available to be used with Cairo,

[R] Problem with grid's text-based units and TrueType fonts

2011-04-25 Thread Al Roark
Hi all: I'm using grid to create a layout in R that will include text mixed with graphics. In the layout, the positions of certain graphical elements depend on the number of lines in adjacent text blocks (which will vary from case to case). I was hoping to use grid's built in functions to aut

[R] Details of subassignment (for vectors and data frames)

2011-08-11 Thread Al Roark
Hi All: I'm looking to find out a bit more about how subassignment actually works and am hoping someone with knowledge of the details can fill me in (I've looked at the source code, but my knowledge of C is lacking). In the case of vectors, my reading of ?"[" would indicate that for a vector,

[R] Mysterious Eclipse / StatET error messages

2011-10-12 Thread Al Roark
All, I'm not sure when this started, but I've noticed that just about any time I add to an R script in Eclipse, I get a warning in Eclipse's error log that looks like the following: Unhandled/Unknown code of R AST node: Code: 0x100 Node: <- (195, 70) Line 4 at offset 195 (can be wro