Re: [R] grepping out columns

2015-02-18 Thread Federico Lasa
David's almost works except it catches the "MONTH" column, just add an empty metacharacter tho. c("DAY", "MONTH", "YEAR", "SA_TUES", "SA_MON", "SU_WED", "CH_TUES", "CH_WED", "CH_MON", "AR_TUES", "AR_WED", "AR_MON", "SA_THUR", "SU_FRI", "CH_THUR", "CH_FRI", "AR_THUR", "AR_FRI")-> columns sa_ind <-

Re: [R] Help with continuous color plot

2014-09-24 Thread Federico Lasa
e geom, and factor the correct variable. On Wed, Sep 24, 2014 at 2:14 PM, Federico Lasa wrote: > Does this resemble what you're after? > > library(reshape2) > tst <- melt(testdataset) > library(ggplot2) > > ggplot(tst, aes(x=Var1, y=Var2, fill=value)) + > geom_ti

Re: [R] Help with continuous color plot

2014-09-24 Thread Federico Lasa
Does this resemble what you're after? library(reshape2) tst <- melt(testdataset) library(ggplot2) ggplot(tst, aes(x=Var1, y=Var2, fill=value)) + geom_tile() + scale_fill_gradient2(low="white", high="white", mid=scales::muted("blue"), midpoint=0.6148377) On Wed, Sep 24, 2014 at 10

Re: [R] ggplot - boxplot and points split by two factors

2014-09-08 Thread Federico Lasa
Use geom_jitter() instead of geom_point On Mon, Sep 8, 2014 at 12:37 PM, Tom Wright wrote: > ggplot(data,aes(x = z1, y = x, fill=x2)) + > geom_boxplot() + > geom_point(alpha=0.5, > position=position_jitterdodge(jitter.width=0.1), > aes(group=x2)) > > On Mon, 2014-09-08 at 13:1

Re: [R] Legend in ggplot2

2014-08-07 Thread Federico Lasa
The problem is that you are not actually 'mapping' any variables to the fill and colour aestethics so ggplot wont produce legends for those. I'm not sure ggplots are appropiate for what you're trying to do here but you can sure hack around it a bit, for instance try: ggplot(tabu, aes(x=weeks, y=T)

Re: [R] multiple plots on same sheet in R

2014-04-16 Thread Federico Lasa
see: ?par Does running par(mfrow=c(4,3)) do the job? On Wed, Apr 16, 2014 at 7:33 AM, eliza botto wrote: > Dear useRs, > I drew 12 separate raster maps. I want to combine them in such a way the they > appear on the same sheet in R, which will later on be saved. Each row should > contain t

Re: [R] Does a survival probability(the probability not experiencing an event) have to be non-increasing?

2014-03-19 Thread Federico Lasa
Don't really understand your equations but. If X is the (random variable of) time of event, then the survival S(x) = 1 - Pr( X < x ) has to be non increasing since: If t1 < t2. then S(t1) - S(t2) = Pr(X < t2) - Pr( X < t1 ) = Pr( t1 < X < t2) > 0 which means that S(t1) > S(t2). But you mu

Re: [R] Knitr, ggplot and consistent fonts

2013-12-23 Thread Federico Lasa
Hi, chiming in. Pasted the code in R studio and the format parser wouldn't mark the R code chunks. It was because there were line breaks in the middle of chunk options tags. Couldn't test if removing line breaks works, but maybe that's the source of the problem? On Mon, Dec 23, 2013 at 10:37 AM,