Re: [R] ggplot2

2012-03-05 Thread Ryan Garner
I found the addendum. http://cloud.github.com/downloads/hadley/ggplot2/guide-col.pdf -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-tp4447745p4448150.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pro

[R] ggplot2

2012-03-05 Thread Ryan Garner
I just updated to R 2.14 with ggplot2 0.9 and am finding bugs. > ggplot2 "GPL-2" "2.14.0" This example is taken from pg 101 in the ggplot book. > plot <- qplot(date, psavert, data = economics, geom = "line") + > ylab("Personal savings rate") + geom_hline(xintercept = 0, colour

Re: [R] X11 graphics windows under CMD BATCH

2011-03-04 Thread Ryan Garner
I had this same issue. My quick and dirty solution was to create an infinite loop at the end of my R plotting script and then manually kill the job with Ctrl+C once I was done looking at the plot. -- View this message in context: http://r.789695.n4.nabble.com/X11-graphics-windows-under-CMD-BATCH-

Re: [R] Parallel Scan of Large File

2010-12-08 Thread Ryan Garner
Hi Jim, Thanks for your insight. I used Linux split to split my large file into smaller partitions. On the server I work on, multipath I/O access is enabled and we use RAID for storage; thus, I don't think I can put each partition on a spindle. I'm able to open multiple files at a time into stdin

[R] Parallel Scan of Large File

2010-12-07 Thread Ryan Garner
Is it possible to parallel scan a large file into a character vector in 1M chunks using scan() with the "doMC" package? Furthermore, can I specify the tasks for each child? i.e. I'm working on a Linux box with 8 cores and would like to scan in 8M records at time (all 8 cores scan 1M records at a

Re: [R] R cmd batch with parameters

2010-12-06 Thread Ryan Garner
http://projects.uabgrid.uab.edu/r-group/wiki/CommandLineProcessing -- View this message in context: http://r.789695.n4.nabble.com/R-cmd-batch-with-parameters-tp3075376p3075587.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-p

Re: [R] Non-visible functions: merge.data.table

2010-12-04 Thread Ryan Garner
Thanks Jim! I posted the specifics of what I'm trying to accomplish here: http://r.789695.n4.nabble.com/Slow-Data-Table-Merge-td3072027.html -- View this message in context: http://r.789695.n4.nabble.com/Non-visible-functions-merge-data-table-tp3072051p3072075.html Sent from the R help mailing l

[R] Non-visible functions: merge.data.table

2010-12-03 Thread Ryan Garner
I've downloaded the "data.table" package from CRAN and R-Forge and still can't utilize merge.data.table for faster merges. How do I make this function visible? > install.packages("data.table",repos="http://R-Forge.R-project.org";) trying URL 'http://R-Forge.R-project.org/src/contrib/data.table_1.

Re: [R] Subset POSIXlt Field

2010-10-05 Thread Ryan Garner
This should work: > test <-subset(wild,ID=="2830" & Date==as.POSIXlt("2010-08-17")) If not, here's another solution: > dates <- c("2010-05-28","2010-08-17") > dates <- as.POSIXlt(dates) > id <- c("2830","2830") > data <- data.frame(id,dates) > test <- data[data$id == "2830" & data$dates == as.POS

Re: [R] Linux System Function

2010-04-24 Thread Ryan Garner
Clever solution. I use paste alot and didn't think to use it for this problem. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Linux-System-Function-tp2063058p2063113.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Linux System Function

2010-04-23 Thread Ryan Garner
How do I pass a filename as an argument to the system command to count the number of records in that file? I only know how to do it by hardcoding it. HARDCODING EXAMPLE > test <- matrix(1:20,ncol=5) > write(x = test,file = "test.txt") > records <- as.numeric(system("cat test.txt | wc -l",intern =

Re: [R] GGPLOT2: Reverse order of legend to match order of x-axis

2010-03-24 Thread Ryan Garner
Hah, my previous post was from my attempt on Windows Vista. It works fine on Linux though. -- View this message in context: http://n4.nabble.com/GGPLOT2-Reverse-order-of-legend-to-match-order-of-x-axis-tp1689526p1689997.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] GGPLOT2: Reverse order of legend to match order of x-axis

2010-03-24 Thread Ryan Garner
Hadley, it doesn't work. Here is my step by step sequence following the Wordpress site instructions. R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistr

[R] GGPLOT2: Reverse order of legend to match order of x-axis

2010-03-24 Thread Ryan Garner
How do I reverse the order of the legend in a bar plot to match order of the x-axis? In other words, I want the stacked colors of the legend to match the stacked colors of the bar plot. I tried this, but it didn't work. colors <- c("5" = "red","4" = "blue","3" = "darkgreen") p <- qplot(factor(cyl

[R] Redhat Linux Install

2010-03-05 Thread Ryan Garner
I just installed R on Redhat Linux at work for the first time and have two questions. 1. I tried to install R to have png and cairo capabilities and was unsuccessful. Before running make, I ran ./configure --with-libpng=yes --with-x=no --with-cairo=yes --with-readline-yes . R installed fine, but

Re: [R] ggsave in Linux

2010-02-24 Thread Ryan Garner
> library(ggplot2) > data(diamonds) > temp <- qplot(cut, color, data=diamonds) > ggsave(temp, file = "test.png") Saving 7" x 7" image Error in grDevices::png(..., width = width, height = height, res = dpi, : X11 is not available -- View this message in context: http://n4.nabble.com/ggsave-in

[R] ggsave in Linux

2010-02-24 Thread Ryan Garner
I have a script that creates a qplot that is then saved as a .png file which works fine on Windows. But I also work on Linux servers via Putty and would like to be able to create and save my plots to my working directory. Is there a way I can ggsave my qplot without utilizing X11 in Linux? I don't

[R] Unordered Factors For ggplot?

2010-02-17 Thread Ryan Garner
I have data that comes into R already ordered. When I use ggplot, it orders them which I don't want. How do I fix this without changing options("contrast")? The data I have is number of days: 30 29 ... 20 19 ... 10 9 ... 1 When I plot with ggplot, it orders them by the first number only. So 3 en

Re: [R] ggplot stacked bar chart help

2010-02-05 Thread Ryan Garner
Almost there! So my previous data example was just a small subset of my true data. I have all the months from 2007-2009 in order. So when I create the barplot following your script, it bins all 12 months for each year -- a stacked barplot with 3 bars (2007,2008,2009), which I don't want. I want e

[R] ggplot stacked bar chart help

2010-02-05 Thread Ryan Garner
I'm trying to create a stacked bar chart with x=month, y=volume, and factor=type. volume type month 100A SEP09 200A OCT09 300A DEC09 400B SEP09 500B OCT09 600B DEC09 700C SEP09 800C