Hi all,I am a complete newby to R having picked up a load of R code from the previous analyst at my new position. I'm trying to get the gist of it, but this new development has me stumped.It all worked fine until I updated R and ggplot2. R version 2.15.2 and ggplot2_0.9.3 [I also had to manually load a bunch of other libraries, so there is the chance that I missed something...]now I get a load of 'depreated code' warnings, and one issue that is an actual problem.Code that did work before around dates now doesn't.my understanding is that lubridate [version: lubridate_1.2.0] handles the date function along with scales (scales_0.2.3)so if existing code says something like:data1$datemonth <- dmy(data1$date)
Below this when you run the code it always says something like:
80 parsed with %d-%b-%y
or
data2$monthdate <- dmy(data2$date)
shows in red:
120 parsed with %d-%b-%y>
>
>
> Which is new but seems ok; But then it flips the date around from ‘7-12-2012’
> to something like 2012-12-07 and says in red after you actually run the code:
Error: Discrete value supplied to continuous scale
(which I can only assume applies to the date data...)below is the code I ran to create the graph:[I've left out the directory commands]# load the necessary libraries/packageslibrary(ggplot2) # This command looks in the library folder in the R program files (C:) to load the package ggplot2, which you had to install there
library(lubridate) # Same thing for the package 'lubridate', which is a set of 'easy' date-related functions
library(scales) # Needed for date formattingdataint1<-read.csv("F_EW1A_INT1.csv")dataint1$monthdate <- dmy(dataint1$date)dataint1$area <- factor(dataint1$area, levels = c("New Zealand", "Canterbury" ))setwd(kCommonDir)ylabel <- ylab("Total cancellations, monthly")
xlabel <- xlab("")titleint1 <- opts(title = comment(dataint1), plot.title = theme_text(size=6, colour="grey", hjust=1))> plotint1 <- ggplot()+
+ theme_bw() +
+ geom_line(data = dataint1, size=1, aes(x = monthdate, y = cancellations, colour=benefit_type)) +
+ scale_colour_manual (values=colours) +
+ yfont +
+ ylabel +
+ xlabel +
+ legend +
+ titleint1 +
+ facet_grid(area ~ ., scale="free_y")
> plotint1thanking you all in anticipation. If there is something extra that you might need to assist, can you let me know how to obtain that info (what code to run or whatever)kind regards,Mark TurnerSocial and Cultural Recovery
Canterbury Earthquake Recovery Authority (CERA)
Private Bag 4999, Christchurch 8140
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
| start | event |
| 4/09/2010 | 1 |
| 22/02/2011 | 2 |



Raphael Mazor Freshwater Biologist Southern California Coastal Water Research Project 3535 Harbor Blvd, Suite 110 Costa Mesa, CA 92626 www.sccwrp.org tel: 714-755-3235 fax: 714-755-3299
Raphael Mazor Freshwater Biologist Southern California Coastal Water Research Project 3535 Harbor Blvd, Suite 110 Costa Mesa, CA 92626 www.sccwrp.org tel: 714-755-3235 fax: 714-755-3299