Re: [R] Help with plotting and date-times for climate data

2023-09-15 Thread Martin Møller Skarbiniks Pedersen
Change geom_point(aes(y = tmax_mean, color = "blue")) to geom_point(aes(y = tmax_mean), color = "blue") if you want blue points. aes(color = ) does not set the color of the points. aes(color = ) takes a column (best if it is a factor) and uses that for different colors. /Martin On Tue, Sep

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
ncludes both min and max > > > thresholds. > > > > > > All I have done is provide an example where min and max could have > > > a real world use. I use max(temp) over some interval and then > > > update an accumulated thermal units variable based on the outcome.

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
t the date (say Day). Group_by the day and apply a max function to the grouped data. Then plot the result. Tim -Original Message- From: Kevin Zembower Sent: Wednesday, September 13, 2023 3:26 PM To: Ebert,Timothy Aaron ; Richard O'Keefe Cc: r-help@r-project.org Subject: Re: [R] Hel

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
rom: Kevin Zembower > Sent: Wednesday, September 13, 2023 2:05 PM > To: Ebert,Timothy Aaron ; Richard O'Keefe > > Cc: r-help@r-project.org > Subject: Re: [R] Help with plotting and date-times for climate data > > [External Email] > > Well, I looked for this, on bo

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
; Richard O'Keefe Cc: r-help@r-project.org Subject: Re: [R] Help with plotting and date-times for climate data [External Email] Well, I looked for this, on both the NWS and WeatherUnderground, but couldn't find what I was looking for. Didn't check Weather.com, but if you can find

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
depends on how far away the trip will be. > > -Original Message- > From: Kevin Zembower > Sent: Wednesday, September 13, 2023 1:22 PM > To: Richard O'Keefe ; Ebert,Timothy Aaron > > Cc: r-help@r-project.org > Subject: Re: [R] Help with plotting and date-times

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
: Wednesday, September 13, 2023 1:22 PM To: Richard O'Keefe ; Ebert,Timothy Aaron Cc: r-help@r-project.org Subject: Re: [R] Help with plotting and date-times for climate data [External Email] Tim, Richard, y'all are reading too much into this. I believe that TMAX is the high temperature

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
Rui, thanks so much for your clear explanation, solution to my problem, and additional help with making the graph come out exactly as I was hoping. I learned a lot from your solution. Thanks, again, for your help. -Kevin On Tue, 2023-09-12 at 23:06 +0100, Rui Barradas wrote: > Às 21:50 de 12/09/2

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
l is not evident in the original request. > > > > Tim > > > > -Original Message- > > From: R-help On Behalf Of Richard > > O'Keefe > > Sent: Wednesday, September 13, 2023 9:58 AM > > To: Kevin Zembower > > Cc: r-help@r-project.org &g

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
; > Tim > > -Original Message- > From: R-help On Behalf Of Richard O'Keefe > Sent: Wednesday, September 13, 2023 9:58 AM > To: Kevin Zembower > Cc: r-help@r-project.org > Subject: Re: [R] Help with plotting and date-times for climate data > > [External Ema

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
On Behalf Of Richard O'Keefe Sent: Wednesday, September 13, 2023 9:58 AM To: Kevin Zembower Cc: r-help@r-project.org Subject: Re: [R] Help with plotting and date-times for climate data [External Email] Off-topic, but what is a "mean temperature max" and what good would it do you

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
Off-topic, but what is a "mean temperature max" and what good would it do you to know you if you did? I've been looking at a lot of weather station data and for no question I've ever had (except "would the newspapers get excited about this") was "max" (or min) the answer. Considering the way that

Re: [R] Help with plotting and date-times for climate data

2023-09-12 Thread Rui Barradas
Às 21:50 de 12/09/2023, Kevin Zembower via R-help escreveu: Hello, I'm trying to calculate the mean temperature max from a file of climate date, and plot it over a range of days in the year. I've downloaded the data, and cleaned it up the way I think it should be. However, when I plot it, the ge

[R] Help with plotting and date-times for climate data

2023-09-12 Thread Kevin Zembower via R-help
Hello, I'm trying to calculate the mean temperature max from a file of climate date, and plot it over a range of days in the year. I've downloaded the data, and cleaned it up the way I think it should be. However, when I plot it, the geom_smooth line doesn't show up. I think that's because my x ax

[R] help with plotting error bars on xyplot!

2015-03-03 Thread Paulo Pagliari
Dear R helpers, I am trying to create a xyplot similar to this one: https://stat.ethz.ch/pipermail/r-help/2008-June/164968.html I can plot the data correctly when I only have one Y. However, I need to add another Y (Y2) to the plot and each Y must have their own error bars and also different s

Re: [R] Help with plotting plsr loadings

2011-06-10 Thread Bjørn-Helge Mevik
Amit Patel writes: >>plot(BHPLS1, "loadings", comps = 1:2, legendpos = "topleft", labels = >>"numbers", >>xlab = "nm") > > Error in loadingplot.default(x, ...) : > Could not convert variable names to numbers. > > > str(BHPLS1_Loadings) > loadings [1:8892, 1:60] -0.00717 0.00414 0.02611 0.0

[R] Help with plotting plsr loadings

2011-06-08 Thread Amit Patel
Hi I am attempting to do a loadings plot from a plsr object. I have managed to do this using the gasoline data that comes with the pls package. However when I conduct this on my dataset i get the following error message. >plot(BHPLS1, "loadings", comps = 1:2, legendpos = "topleft", labels =

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-28 Thread Peter Ehlers
On 2011-03-28 09:33, Pam Allen wrote: Thank you Jim and David for your help. The 'levels' call is not a misdirection, in my actual dataset it is necessary because the flows aren't symmetrical. So while your solution is quite elegant David, it doesn't apply to my actual data, just the example.

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-28 Thread Pam Allen
Thank you Jim and David for your help. The 'levels' call is not a misdirection, in my actual dataset it is necessary because the flows aren't symmetrical. So while your solution is quite elegant David, it doesn't apply to my actual data, just the example. Too bad, it's quite nice! I do think

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Jim Lemon
On 03/26/2011 07:19 AM, Pam Allen wrote: Hello again, I wrote an example that better represents my data, since the coloured points are actually consecutive, but with variable lengths: date=as.Date(c(1:300)) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c("high","med","low"),100)) data=cbind.data.fram

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Pam Allen
Hello again, I wrote an example that better represents my data, since the coloured points are actually consecutive, but with variable lengths: date=as.Date(c(1:300)) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c("high","med","low"),100)) data=cbind.data.frame(date, flow, levels) library(zoo) z <- z

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread David Winsemius
On Mar 25, 2011, at 3:23 PM, Pam Allen wrote: Hello Baptiste and others, I tried your example with my dataset, and for a few days I thought it worked for me. But I realized yesterday that the result wasn't quite what I hoped for. In my actual data the flows aren't perfectly sinusoidal, a

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-25 Thread Pam Allen
Hello Baptiste and others, I tried your example with my dataset, and for a few days I thought it worked for me. But I realized yesterday that the result wasn't quite what I hoped for. In my actual data the flows aren't perfectly sinusoidal, and I used a series of ifelse queries to code the flow

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-17 Thread David Winsemius
On Mar 17, 2011, at 6:33 PM, Pamela Allen wrote: Hi All, I'm trying to plot data that is a time series of flows that are associated with a specific level, and I would like each level to represent a colour in a line plot. Here is some data that approximates what I'm using: date=c(1:300)

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-17 Thread Tóth Dénes
Indeed, I forgot about the segments function. with(d,plot(date,flow,type="n")) with(d,segments(start,start.y,end,end.y,col=colour)) > Hi, > > because each colour is defined on non-consecutive points, you'll > probably need to cut the intervals to define segments around each > point. One approa

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-17 Thread baptiste auguie
Hi, because each colour is defined on non-consecutive points, you'll probably need to cut the intervals to define segments around each point. One approach might be the following, d = transform(data, start = date - c(0, diff(date)/2), end = date + c(0, diff(date)/2) ) d$start.y = approx(d$date, d

Re: [R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-17 Thread Tóth Dénes
Hi! Not an elegant solution, but seems to work: date <- c(1:300) flow <- sin(2*pi/53*c(1:300)) levels <- factor(rep(c("high","med","low"),100)) data <- cbind.data.frame(date, flow, levels) colours <- as.numeric(levels)+1 # interpolate resolution <- 0.001 appres <- approx(date,flow,seq(min(date

[R] Help with plotting a line that is multicoloured based on levels of a factor

2011-03-17 Thread Pamela Allen
Hi All, I'm trying to plot data that is a time series of flows that are associated with a specific level, and I would like each level to represent a colour in a line plot. Here is some data that approximates what I'm using: date=c(1:300) flow=sin(2*pi/53*c(1:300)) levels=c(rep(c("

[R] Help with plotting kohonen maps

2010-11-22 Thread Stella Pachidi
Dear all, I recently started using the kohonen package for my thesis project. I have a very simple question which I cannot figure out by myself: When I execute the following example code, from the paper of Wehrens and Buydens (http://www.jstatsoft.org/v21/i05/paper): R> library("kohonen") Loadin

Re: [R] help with plotting lines linking two sets of points?

2010-04-23 Thread Dennis Murphy
Hi: Does this work for you? df <- read.table(textConnection(" pool age age2 density body_length body_length2 11 7.4 11.3 25 0.887 1.322550 22 7.4 11.3 100 0.921 1.152000 33 7.4 11.3 250 0.896 1.136300 44 7.4 11.3 75 0.723

[R] help with plotting lines linking two sets of points?

2010-04-22 Thread Kristiina Hurme
Hello everyone, I'm trying to plot the initial and final size of some tadpoles and look at their growth rates (slope of line). They are divided into 6 densities, and so far I have plotted the initial and final sizes (these are means for a pool), and color coded for the 6 densities, but I want a l

Re: [R] help with plotting

2009-09-11 Thread Steve Lianoglou
Hi Edward, On Sep 11, 2009, at 1:47 PM, Edward Chen wrote: HI all, raw_urine = read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\mz.spot.sam.dat.new ", header = TRUE ) pvalue = read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\all.urine.features.t.test.result ", he

[R] help with plotting

2009-09-11 Thread Edward Chen
HI all, raw_urine = read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\mz.spot.sam.dat.new", header = TRUE ) pvalue = read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\all.urine.features.t.test.result", header = TRUE ) library(compositions) p = function(a,b){ y = pvalue[,a]

Re: [R] help with plotting results of lda

2009-04-26 Thread Prof Brian Ripley
On Sun, 26 Apr 2009, Uwe Ligges wrote: Works for me with library(MASS) plot(lda(Species~., data=iris)) hence you may want to profide the data to enable us to reproduce your problem... He is trying to plot the results from a cross-validation. As the help page clearly states, that is a list

Re: [R] help with plotting results of lda

2009-04-26 Thread Uwe Ligges
Works for me with library(MASS) plot(lda(Species~., data=iris)) hence you may want to profide the data to enable us to reproduce your problem... Uwe Ligges pgseye wrote: Hi, I've performed an lda and obtained a classification table for some of my data: efa.dfa<-lda(groups~.,efa.scores.

[R] help with plotting results of lda

2009-04-26 Thread pgseye
Hi, I've performed an lda and obtained a classification table for some of my data: > efa.dfa<-lda(groups~.,efa.scores.8,CV=T) > str(efa.dfa) List of 5 $ class: Factor w/ 2 levels "1","2": 1 2 1 2 1 1 2 2 1 2 ... $ posterior: num [1:160, 1:2] 0.99083 0.00852 0.93983 0.23186 0.85931 ... ..