[R] Using tabs in output instead of spaces

2009-10-12 Thread ws
Is there a way to have xtabs and friends use tabs in their output to separate columns rather than spaces? It would be great for importing into other software. TIA! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-24 Thread ws
Webb Sprague webb.sprague at gmail.com writes: xtabs(~wkhp, x, exclude=NULL, na.action=na.pass) wkhp  20   30   40   45   60 NA   1    1   10    1    3    4 now this doesn't even work table(wtf, exclude=NULL) wtf [0,10) [10,20) [20,30) [30,40) [40,50) [50,60)

Re: [R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-23 Thread ws
Webb Sprague webb.sprague at gmail.com writes: xtabs(~wkhp, x, exclude=NULL, na.action=na.pass) wkhp  20   30   40   45   60 NA   1    1   10    1    3    4 (Forgive me for the repost, but I just joined the R list, so maybe this will go through.) Now the above doesn't work! See :

[R] Errors and line numbers in scripts?

2009-09-17 Thread ws
Is there a way to have R return the line number in a script when it errors out? I call my script like: $ R --vanilla script.R output.txt I seem to remember a long discussion about this at some point, but I can't remember the outcome. Tx __

[R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-04 Thread ws
Hi all, I cannot get xtabs to count NA's like I expect. Below is a sample session, and note that the last two calls to xtabs() yield exactly the same thing. I am running R-2.5.0 -- if there was a bug in xtabs that got fixed, I would love to know about it. If there is a bug tracker somewhere,

Re: [R] pyramid.plot: x-axis scale

2009-07-31 Thread ws
Hi ws, You could tweak pyramid.plot in the plotrix package to do this. I guess I will live without... Unless you can spell the process out for doing that -- where is the source, where would the package download be on my machine before (Mac OS X), who would I send a working patch

[R] pyramid.plot: x-axis scale

2009-07-29 Thread ws
Hi R-ers Does anyone know how if there is a way to force pyramid plot where you determine the bottom axis range? I want to compare many different pyramids, so I am hoping to force the bottom axis range from 0% to 10%. Here is the code so far, if it matters: mk.pyr = function(data,

[R] Transparency and pyramid.plot

2009-07-29 Thread ws
Hi all Another question related to my earlier -- how might I get transparency to work with pyramid.plot in library(plotrix)? I can't figure it out, and the help page says it is there but doesn't give an example. Thanks! __ R-help@r-project.org

Re: [R] Assigning rank based on total count

2009-07-27 Thread ws
I am using ACS micro data (PUMS) with one of the columns as a factor for the place of birth (POBPF). I would like to create a column (POBR) containing a rank corresponding to the place of the observation in the POBPF rankings. I wrote a blog entry on my solution:

[R] Assigning rank based on total count

2009-07-23 Thread ws
Hi all, I am using ACS micro data (PUMS) with one of the columns as a factor for the place of birth (POBPF). I would like to create a column (POBR) containing a rank corresponding to the place of the observation in the POBPF rankings. For example, if a person is from Oregon, Oregon is the

Re: [R] Assigning rank based on total count

2009-07-23 Thread ws
Here's a way to get to your solution, but it's not very pretty: testdfr - data.frame(POB=c(Oregon,Oregon,Oregon,New York,California,California)) nstates - length(unique(testdfr$POB)) testdfr$ POBR - c(nstates:1)[table(testdfr$POB)][testdfr$POB] Hmm I will have to think on that for