Re: [R] plot(aov, which=1) with different labels?

2024-06-20 Thread Duncan Murdoch
On 2024-06-20 2:01 a.m., DynV Montrealer wrote: I need to do a non-English report including the red line from plot(aov, which=1), which I don't know how to reproduce. I'm thinking that if I replace the labels that it would be good (so no English remains). What I have so far is almost what I need,

Re: [R] Plot for 10 years extrapolation

2023-10-28 Thread varin sacha via R-help
Dear Rui, I really thank you a lot for your precious R help. It is exactly what I was trying to do! Once more, many thanks! Best, Sacha Le vendredi 27 octobre 2023 à 09:36:18 UTC+2, Rui Barradas a écrit : Às 19:23 de 26/10/2023, varin sacha via R-help escreveu: > Dear R-Experts, >

Re: [R] Plot for 10 years extrapolation

2023-10-27 Thread Rui Barradas
Às 19:23 de 26/10/2023, varin sacha via R-help escreveu: Dear R-Experts, Here below my R code working but I don't know how to complete/finish my R code to get the final plot with the extrapolation for the10 more years. Indeed, I try to extrapolate my data with a linear fit over the next 10 yea

Re: [R] Plot for 10 years extrapolation

2023-10-26 Thread Bert Gunter
Incidentally, if all you wanted to do was plot fitted values, the predict method is kinda overkill, as it's just the fitted line from the model. But I assume you wanted to plot CI's/PI's also, as the example illustrated. -- Bert On Thu, Oct 26, 2023 at 1:56 PM Bert Gunter wrote: > > from ?predic

Re: [R] Plot for 10 years extrapolation

2023-10-26 Thread Bert Gunter
from ?predict.lm: "predict.lm produces a vector of predictions or a matrix of predictions and bounds with column names fit, lwr, and upr if interval is set. " ergo: predict(model, dfuture, interval = "prediction")[,"fit"] ## or [,1] as it's the first column in the returned matrix is your vector

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Shu Fai Cheung
Thanks for the suggestion. I believe it is exactly what I need. I will try this function. Thanks! Regards, Shu Fai On Mon, Oct 16, 2023 at 3:39 AM Paul Murrell wrote: > > Hi > > You could also look at dev.capture(), depending on which screen device > you are using. > > Paul > > On 16/10/23 05:24

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Shu Fai Cheung
Thanks a lot for introducing these functions! I am not aware of them but it seems that they can help me to do what I want to do. Regards, Shu Fai Regards, Shu Fai Cheung (張樹輝) On Mon, Oct 16, 2023 at 12:24 AM Duncan Murdoch wrote: > > On 15/10/2023 12:05 p.m., Shu Fai Cheung wrote: > > Let me

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Paul Murrell
Hi You could also look at dev.capture(), depending on which screen device you are using. Paul On 16/10/23 05:24, Duncan Murdoch wrote: On 15/10/2023 12:05 p.m., Shu Fai Cheung wrote: > Let me clarify my question: > > plot.new() > polygon(c(.5, .5, .75, .8), c(.25, .3, .4, .5)) > > If t

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Duncan Murdoch
On 15/10/2023 12:05 p.m., Shu Fai Cheung wrote: Let me clarify my question: plot.new() polygon(c(.5, .5, .75, .8), c(.25, .3, .4, .5)) If the device is an on-screen device, can I check whether a particular area has anything drawn on it, or, to be precise, whether the color of a particular area

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Shu Fai Cheung
Let me clarify my question: plot.new() polygon(c(.5, .5, .75, .8), c(.25, .3, .4, .5)) If the device is an on-screen device, can I check whether a particular area has anything drawn on it, or, to be precise, whether the color of a particular area has all pixels equal to the background color. That

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Shu Fai Cheung
Sorry that I did not make my question clear enough. If the device is file based (e.g., a PNG file), then I believe I can do that, by using functions that can inspect an image. This is the solution I originally wanted to try. However, it requires creating a file in the process. I would like to see

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Jeff Newmiller via R-help
This question is not clear to me. What is it you hope to retrieve from the device? Note that the type of device in your example is system-dependent. The content in a png() would be different than the content in a win.graph() device. On October 15, 2023 8:04:00 AM PDT, Shu Fai Cheung wrote: >H

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Deepayan Sarkar
box(col='grey') > > axis(1) > > > > Best, > > Wolfgang > > > That's exactly what I needed. > > > Thanks, Spencer > > > > >> -Original Message- > >> From: R-help [mailto:r-help-boun...@r-project.org] On Behal

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Spencer Graves
X.[, 3], ylab='accel (%)', axes=FALSE) axis(2) box(col='grey') axis(1) Best, Wolfgang That's exactly what I needed. Thanks, Spencer -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Spencer Graves Sent: Wednesday, 31 Ma

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Viechtbauer, Wolfgang (NP)
box(col='grey') axis(1) Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Spencer Graves >Sent: Wednesday, 31 May, 2023 17:45 >To: Eric Berger >Cc: r-help >Subject: Re: [R] plot level, velocity, acceleration wit

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Spencer Graves
On 5/31/23 9:20 AM, Eric Berger wrote: I sent you an updated response to deal with the redundant copies of the x-axis. Re-sending. par(mfrow=c(3,1)) plot(DAX.[, 1], log='y', ylab='DAX', xaxt="n") plot(DAX.[, 2], ylab='vel (%)', xaxt="n") plot(DAX.[, 3], ylab='accel (%)') I got that. Th

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Eric Berger
I sent you an updated response to deal with the redundant copies of the x-axis. Re-sending. par(mfrow=c(3,1)) plot(DAX.[, 1], log='y', ylab='DAX', xaxt="n") plot(DAX.[, 2], ylab='vel (%)', xaxt="n") plot(DAX.[, 3], ylab='accel (%)') On Wed, May 31, 2023 at 4:27 PM Spencer Graves wrote: > > > >

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Spencer Graves
On 5/30/23 10:23 AM, Eric Berger wrote: What if you just precede these commands as follows: par(mfrow=c(3,1)) plot(DAX.[, 1], log='y', ylab='DAX') plot(DAX.[, 2], ylab='vel (%)') plot(DAX.[, 3], ylab='accel (%)') Most of the space is consumed with two extraneous copies of the axis. We

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Eric Berger
Slight modification to have the xaxt ticks and labels only appear on the bottom chart par(mfrow=c(3,1)) plot(DAX.[, 1], log='y', ylab='DAX', xaxt="n") plot(DAX.[, 2], ylab='vel (%)', xaxt="n") plot(DAX.[, 3], ylab='accel (%)') On Tue, May 30, 2023 at 6:23 PM Eric Berger wrote: > > What if you j

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Eric Berger
What if you just precede these commands as follows: par(mfrow=c(3,1)) plot(DAX.[, 1], log='y', ylab='DAX') plot(DAX.[, 2], ylab='vel (%)') plot(DAX.[, 3], ylab='accel (%)') On Tue, May 30, 2023 at 5:45 PM Spencer Graves wrote: > > > > On 5/30/23 8:48 AM, Eric Berger wrote: > > I am a bit confuse

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Spencer Graves
On 5/30/23 8:48 AM, Eric Berger wrote: I am a bit confused as to what you are trying to achieve - and even if I could guess it is not clear what the interpretation would be. head(DAX) 1628.75 1613.63 1606.51 1621.04 1618.16 1610.61 Including the leading NA's, what would be the 6 leading te

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Eric Berger
I am a bit confused as to what you are trying to achieve - and even if I could guess it is not clear what the interpretation would be. > head(DAX) 1628.75 1613.63 1606.51 1621.04 1618.16 1610.61 Including the leading NA's, what would be the 6 leading terms of the 3 series that you want to plot, a

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Spencer Graves
On 5/30/23 6:16 AM, Eric Berger wrote: My code assumes that DAX is a ts object, as in your original post. On Tue, May 30, 2023 at 2:06 PM Eric Berger wrote: Untested but why not a <- cbind(log(DAX), exp(diff(log(DAX))), exp(diff(diff(log(DAX) colnames(a) <- c("logDAX", "vel", "accel")

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Eric Berger
My code assumes that DAX is a ts object, as in your original post. On Tue, May 30, 2023 at 2:06 PM Eric Berger wrote: > > Untested but why not > > a <- cbind(log(DAX), exp(diff(log(DAX))), exp(diff(diff(log(DAX) > colnames(a) <- c("logDAX", "vel", "accel") > plot(a) > > > On Tue, May 30, 2023

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Eric Berger
Untested but why not a <- cbind(log(DAX), exp(diff(log(DAX))), exp(diff(diff(log(DAX) colnames(a) <- c("logDAX", "vel", "accel") plot(a) On Tue, May 30, 2023 at 1:46 PM Spencer Graves wrote: > > > > On 5/29/23 2:37 AM, Eric Berger wrote: > > How about this: > > > > a <- cbind(AirPassengers,

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-30 Thread Spencer Graves
On 5/29/23 2:37 AM, Eric Berger wrote: How about this: a <- cbind(AirPassengers, diff(log(AirPassengers)), diff(diff(log(AirPassengers colnames(a)[2:3] <- c("percent increase", "acceleration") plot(a, xlab="year", main="AirPassengers") My real problem is more difficult: I'm analyzi

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-29 Thread Spencer Graves
On 5/29/23 2:37 AM, Eric Berger wrote: How about this: a <- cbind(AirPassengers, diff(log(AirPassengers)), diff(diff(log(AirPassengers colnames(a)[2:3] <- c("percent increase", "acceleration") plot(a, xlab="year", main="AirPassengers") That's it. Thanks. sg HTH, Eric On Mon, May

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-29 Thread Eric Berger
How about this: a <- cbind(AirPassengers, diff(log(AirPassengers)), diff(diff(log(AirPassengers colnames(a)[2:3] <- c("percent increase", "acceleration") plot(a, xlab="year", main="AirPassengers") HTH, Eric On Mon, May 29, 2023 at 7:57 AM Spencer Graves wrote: > > Hello, All: > > >

Re: [R] Plot R graphs in aws

2023-04-23 Thread Hasan Diwan
Alternatively, you can put R-studio server on AWS by going to https://www.louisaslett.com/RStudio_AMI/. -- H On Thu, 20 Apr 2023 at 04:58, Duncan Murdoch wrote: > On 20/04/2023 7:43 a.m., Naresh Gurbuxani wrote: > > In my Amazon Web Services (AWS) account, I use R via emacs launched from > termi

Re: [R] Plot R graphs in aws

2023-04-20 Thread Duncan Murdoch
On 20/04/2023 7:43 a.m., Naresh Gurbuxani wrote: In my Amazon Web Services (AWS) account, I use R via emacs launched from terminal. While R computations work well, viewing graphs is inconvenient. I am not able to use screen device. I can send graphs to a png or pdf file, then open the file.

Re: [R] Plot a line using ggplot2

2022-12-08 Thread Ebert,Timothy Aaron
A number of problems. The variable names are not helpful. PointEstx is not a point it is a value. I need an x and a y coordinate for a point. row1 is not defined While there is a function data.frame(), there is no data_frame(). Making this change gives an error that row1 is not defined. I solved

Re: [R] Plot a line using ggplot2

2022-12-08 Thread Jeff Newmiller
Please run your code before you send it. Your example is not reproducible. library(ggplot2) linedata<- data.frame( PointEstx = c( 1, 2 ) , PointEsty = c( 1, 1.5 ) ) # make sure we have a data frame str(linedata) #plot the data ggplot( linedata , aes( x = PointEstx , y = PointEsty )

Re: [R] Plot by month

2022-02-27 Thread Jim Lemon
Hi ektaraK, Here is a step by step way to create an example and get your plot: # make up a lot of dates dates<-as.Date("2021-1-1")+sample(0:364,100) # make up the temperatures temps<-runif(100,0,40) # create a data frame mydf<-data.frame(date=dates,temp=temps) # create a month variable mydf$month<

Re: [R] Plot NUTS regions with color

2021-06-23 Thread Bert Gunter
I suggest you post this in the r-sig-geo list rather than here. The expertise you seek is more likely to be there. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Re: [R] Plot GEE confindence interval band ggplot2

2021-06-01 Thread Rui Barradas
Hello, I don't know if the following is what you want but it gives confidence bars. The error in your code is to have Esp as id. dat$Id <- as.integer(factor(dat$Esp)) m5 <- geeglm( formula = tim ~ Pa*Pt, family = Gamma(link = log), data = dat, id = Id, corstr = "exchangeable" ) plo

Re: [R] Plot with some countries in red

2021-05-19 Thread PIKAL Petr
Hi For your example sel <- c(1,4, 9, 11) text(B, C, A, col= c("black", "red")[(A %in% A[sel])+1]) gives you required colouring.Not sure if it works with basicPlotteR. Cheers Petr -Original Message- From: R-help On Behalf Of varin sacha via R-help Sent: Wednesday, May 19, 2021 3:14 PM

Re: [R] Plot dataframe with color based on a column value

2021-01-24 Thread Luigi Marongiu
I did not know about matplot, but it did the work. using lines is my default procedure but it can be time-consuming. Thank you all. On Sun, Jan 24, 2021 at 6:45 PM Rui Barradas wrote: > > Hello, > > Base R: > > colrs <- rainbow(length(unique(ROI$Z))) > roi_wide <- reshape(ROI, v.names = "Y", time

Re: [R] Plot dataframe with color based on a column value

2021-01-24 Thread Rui Barradas
Hello, Base R: colrs <- rainbow(length(unique(ROI$Z))) roi_wide <- reshape(ROI, v.names = "Y", timevar = "Z", idvar = "X", direction = "wide") matplot(roi_wide, type = "l", lwd = 3, lty = "solid", col = colrs) Hope this helps, Rui Barradas Às 14:48 de 24/01/21, Luigi Marongiu escreveu: He

Re: [R] Plot dataframe with color based on a column value

2021-01-24 Thread Bert Gunter
No. I was wrong. ?plot.default says only one line color (the first) will be used. So it appears that you need to use lines(). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

Re: [R] Plot dataframe with color based on a column value

2021-01-24 Thread Bert Gunter
1. lines() *is* base R. 2. See the col argument of ?plot.default. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Jan 24, 2021 at 6:48 AM Luigi Marongiu

Re: [R] Plot histogram and lognormal fit on the same time

2021-01-22 Thread Bert Gunter
OK, but that's not the point of my comment. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jan 22, 2021 at 5:03 PM Abby Spurdle wrote: > Sorry, Bert. >

Re: [R] Plot histogram and lognormal fit on the same time

2021-01-22 Thread Abby Spurdle
Sorry, Bert. The fitdistr function estimates parameters via maximum likelihood. (i.e. The "lognormal" part of this, is not a kernel). On Fri, Jan 22, 2021 at 5:14 AM Bert Gunter wrote: > > In future, you should try to search before posting. I realize that getting > good search terms can sometime

Re: [R] Plot histogram and lognormal fit on the same time

2021-01-21 Thread Rui Barradas
Hello, A solution based on Marc's first one, maybe easier? (It doesn't rely on multiplying the dlnorm values by 400 since it plots the histogram with freq = FALSE.) set.seed(2020) data <- rlnorm(100, meanlog = 1, sdlog = 1) library(MASS) f <- fitdistr(data, "lognormal") f$estimate p <- pr

Re: [R] Plot histogram and lognormal fit on the same time

2021-01-21 Thread Bert Gunter
In future, you should try to search before posting. I realize that getting good search terms can sometimes be tricky, but not in this case: 'plot density with histogram in R' or similar on rseek.org or just on your usual search platform brought up several ways to do it. As a (slightly offtopic) si

Re: [R] Plot histogram and lognormal fit on the same time

2021-01-21 Thread Marc Girondot via R-help
Two solutions not exactly equivalent ; data <- rlnorm(100, meanlog = 1, sdlog = 1) histdata <- hist(data, ylim=c(0, 100)) library(MASS) f <- fitdistr(data, "lognormal") f$estimate lines(x=seq(from=0, to=50, by=0.1), � y=dlnorm(x=seq(from=0, to=50, by=0.1), meanlog = f$estimate["meanlog"], sdl

Re: [R] plot factors with dots in R

2020-08-31 Thread Luigi Marongiu
Thank you, all solutions work! On Fri, Aug 28, 2020 at 9:02 AM Deepayan Sarkar wrote: > > On Thu, Aug 27, 2020 at 5:46 PM Luigi Marongiu > wrote: > > > > Hello, > > I have a dataframe as follows: > > ``` > > x = c("0 pmol", "10 pmol", "100 pmol", "1000 pmol") > > y = c(0.9306, 1.8906, 2.2396, 2

Re: [R] plot factors with dots in R

2020-08-28 Thread Deepayan Sarkar
On Thu, Aug 27, 2020 at 5:46 PM Luigi Marongiu wrote: > > Hello, > I have a dataframe as follows: > ``` > x = c("0 pmol", "10 pmol", "100 pmol", "1000 pmol") > y = c(0.9306, 1.8906, 2.2396, 2.7917) > df = data.frame(x, y) > > > str(df) > 'data.frame': 4 obs. of 2 variables: > $ x: chr "0 pmol"

Re: [R] plot factors with dots in R

2020-08-27 Thread Jim Lemon
Hi Luigi, Maybe just: plot(as.numeric(factor(x,levels=x)),y,xaxt="n", main="Concentration by effect", xlab="Concentration",ylab="Effect") axis(1,at=1:4,labels=x) Jim On Thu, Aug 27, 2020 at 10:16 PM Luigi Marongiu wrote: > > Hello, > I have a dataframe as follows: > ``` > x = c("0 pmol", "10

Re: [R] plot factors with dots in R

2020-08-27 Thread Rui Barradas
Hello, The plots that you say give bars (or my equivalent version below) don't give bars, what they give are boxplots with just one value and the median Q1 and Q3 are all equal. plot(y ~ factor(x), df, pch = 16) # boxplot Is the following what you are looking for? plot(y ~ as.integer(fac

Re: [R] plot factors with dots in R

2020-08-27 Thread Luigi Marongiu
Thank you, better than before... On Thu, Aug 27, 2020 at 2:37 PM PIKAL Petr wrote: > > Hi. > It is probably somewhere in docs, but factors are actually numerics vith > labels. > > So with your original data frame > > df$x <- factor(df$x) > plot(as.numeric(df$x), df$y) > > gives you points. You ne

Re: [R] plot factors with dots in R

2020-08-27 Thread PIKAL Petr
Hi. It is probably somewhere in docs, but factors are actually numerics vith labels. So with your original data frame df$x <- factor(df$x) plot(as.numeric(df$x), df$y) gives you points. You need to set labels to x axis though. Cheers Petr > -Original Message- > From: R-help On Behalf

Re: [R] Plot math symbol with string and number

2020-08-18 Thread Rasmus Liland
On 2020-08-18 11:02 +1200, Paul Murrell wrote: | On 18/08/20 9:54 am, Bert Gunter wrote: | | On Mon, Aug 17, 2020 at 2:14 PM wrote: | | | | | | Plotmath seems to be the right way | | | to do it. But without reading | | | plotmath I'd have gone with this: | | | | | | plot(y, main=paste("data",

Re: [R] Plot math symbol with string and number

2020-08-17 Thread Paul Murrell
I think that comment is fair *on graphics devices that can handle unicode*. So that is true for Cairo-based graphics devices, but not for the pdf() or postscript() devices, for example. Paul On 18/08/20 9:54 am, Bert Gunter wrote: "Plotmath seems to be the right way to do it." Not sure I

Re: [R] Plot math symbol with string and number

2020-08-17 Thread Bert Gunter
"Plotmath seems to be the right way to do it. " Not sure I agree with that. Paul Murrell put together plotmath around 2000 prior to the widescale development and adoption of the unicode standard (corrections/modifications welcome!). So at the time, there really was no other way to handle this for

Re: [R] Plot math symbol with string and number

2020-08-17 Thread Rasmus Liland
On 2020-08-17 22:14 +0100, cpolw...@chemo.org.uk wrote: | On 2020-08-17 03:13, Rasmus Liland wrote: | | On Sun, Aug 16, 2020 at 3:18 PM Bert wrote: | | | | | | ?plotmath | | | | Dear John, read ?plotmath, it is | | good, I was not aware of its | | existence; then backquote s like | | so: | | P

Re: [R] Plot math symbol with string and number

2020-08-17 Thread cpolwart
On 2020-08-17 03:13, Rasmus Liland wrote: On Sun, Aug 16, 2020 at 3:18 PM Bert wrote: | On Sun, Aug 16, 2020, 14:53 John wrote: | | | | I would like to make plots with | | titles for different data sets and | | different parameters. The first | | title doesn't show sigma as a math | | symbol, whi

Re: [R] Plot math symbol with string and number

2020-08-17 Thread John Smith
Thanks to Dunkan, Rasmus and Bert. Will keep the very useful tips. Best! On Sun, Aug 16, 2020 at 9:13 PM Rasmus Liland wrote: > On Sun, Aug 16, 2020 at 3:18 PM Bert wrote: > | On Sun, Aug 16, 2020, 14:53 John wrote: > | | > | | I would like to make plots with > | | titles for different data sets

Re: [R] Plot math symbol with string and number

2020-08-16 Thread Rasmus Liland
On Sun, Aug 16, 2020 at 3:18 PM Bert wrote: | On Sun, Aug 16, 2020, 14:53 John wrote: | | | | I would like to make plots with | | titles for different data sets and | | different parameters. The first | | title doesn't show sigma as a math | | symbol, while the second one | | doesn't contain

Re: [R] Plot math symbol with string and number

2020-08-16 Thread Bert Gunter
Specifically, see the "how to combine "math" and numeric variables" in the Examples therein. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Aug 16, 2020 a

Re: [R] Plot math symbol with string and number

2020-08-16 Thread Bert Gunter
?plotmath On Sun, Aug 16, 2020, 14:53 John Smith wrote: > Dear Helpers, > > I would like to make plots with titles for different data sets and > different parameters. So a useful title should combine data name > and parameter for clarity. The following is a simplified code example with > two plo

Re: [R] Plot base 100

2020-07-20 Thread Joshua Ulrich
You can do this with PerformanceAnalytics. library(PerformanceAnalytics) data(edhec) chart.RelativePerformance(edhec, 0, legend = "topleft") Also note that there's a finance-specific mailing list: R-SIG-Finance. Best, Josh On Sun, Jul 19, 2020 at 1:46 PM Pedro páramo wrote: > > Hi all, > > I a

Re: [R] Plot base 100

2020-07-20 Thread Pedro páramo
I understand. I Will send my Code tomorrow, I am outside home now. Many thanks David, sorry about all. El dom., 19 jul. 2020 21:13, David Winsemius escribió: > > On 7/19/20 11:18 AM, Pedro páramo wrote: > > Hi all, > > > > I am trying to make a plot based on stock market prices and the library

Re: [R] Plot base 100

2020-07-19 Thread Jim Lemon
Hi Pedro, Assuming that you get a vector of daily percentage changes: dpc<-c(+3.1, -2.8, +1.7, +2.1) get the cumulative change and add 100: cumsum(dpc)+100 [1] 103.1 100.3 102.0 104.1 You can then plot that. As Rui noted, your mail client is inserting invisible characters that prevent cutting a

Re: [R] Plot base 100

2020-07-19 Thread David Winsemius
On 7/19/20 11:18 AM, Pedro páramo wrote: Hi all, I am trying to make a plot based on stock market prices and the library quantmod, imagine BatchGetSymbols(‘^IBEX’, first.date = ‘1999-12-31’, last.date = ‘2020-12-07’) The thing is I want to plot a plot that for each year on 31/12/year tthe

Re: [R] plot shows exponential values incompatible with data

2020-07-10 Thread Fox, John
Dear Jim, As I pointed out yesterday, setting ylim as you suggest still results in "0e+00" as the smallest tick mark, as it should for evenly spaced ticks. Best, John > On Jul 10, 2020, at 12:13 AM, Jim Lemon wrote: > > Hi Luigi, > This is a result of the "pretty" function that calculates h

Re: [R] plot shows exponential values incompatible with data

2020-07-10 Thread Luigi Marongiu
Thank you! I reckon the main problem is the large data range, anyway. I should stick with logarithmic scales... Best regards Luigi On Fri, Jul 10, 2020 at 6:14 AM Jim Lemon wrote: > > Hi Luigi, > This is a result of the "pretty" function that calculates hopefully > good looking axis ticks automat

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Jim Lemon
Hi Luigi, This is a result of the "pretty" function that calculates hopefully good looking axis ticks automatically. You can always specify ylim=c(1.0E09,max(Y)) if you want. Jim On Thu, Jul 9, 2020 at 10:59 PM Luigi Marongiu wrote: > > Hello, > I have these vectors: > ``` > X <- 1:7 > Y <- c(14

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Fox, John
Dear Bernard, > On Jul 9, 2020, at 10:25 AM, Bernard Comcast > wrote: > > Use the xlim option in the plot function? I think you mean ylim, but as you'll find out when you try it, you still (reasonably) get an evenly spaced tick mark at 0: plot(Y ~ X, ylim=c(1e9, 6e11)) The "right" thing to

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Rui Barradas
Hello, Like this? plot(Y~X, log="y") Hope this helps, Rui Barradas Às 14:59 de 09/07/20, Luigi Marongiu escreveu: Thank you, but why it does not work in linear? With the log scale, I know it works but I am not looking for it; is there a way to force a linear scale? Regards Luigi On Thu, J

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Bernard Comcast
Use the xlim option in the plot function? Bernard Sent from my iPhone so please excuse the spelling!" > On Jul 9, 2020, at 10:06 AM, Luigi Marongiu wrote: > > Thank you, > but why it does not work in linear? With the log scale, I know it > works but I am not looking for it; is there a way to f

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Bert Gunter
Please consult ?axis and follow its links (e.g. "axTicks" and "pretty") for the details of the algorithm used to construct axis annotation. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Fox, John
Dear Luigi, > On Jul 9, 2020, at 9:59 AM, Luigi Marongiu wrote: > > Thank you, > but why it does not work in linear? With the log scale, I know it > works but I am not looking for it; is there a way to force a linear > scale? The scale *is* linear and the choice of tick marks, which are evenly

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Luigi Marongiu
Thank you, but why it does not work in linear? With the log scale, I know it works but I am not looking for it; is there a way to force a linear scale? Regards Luigi On Thu, Jul 9, 2020 at 3:44 PM Fox, John wrote: > > Dear Luigi, > > > On Jul 9, 2020, at 8:59 AM, Luigi Marongiu wrote: > > > > He

Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Fox, John
Dear Luigi, > On Jul 9, 2020, at 8:59 AM, Luigi Marongiu wrote: > > Hello, > I have these vectors: > ``` > X <- 1:7 > Y <- c(1438443863, 3910100650, 10628760108, 28891979048, 78536576706, > 213484643920, 580311678200) > plot(Y~X) > ``` > The y-axis starts at 0e0, but the first value is 1.4 billi

Re: [R] Plot two values on same axes

2019-09-27 Thread Rich Shepard
On Fri, 27 Sep 2019, Rolf Turner wrote: You may better off using base R graphics, unless there are considerations which demand the use of lattice. Something like this, maybe: plot(maxtemp ~ sampdate, data=watertemp, type="h", col="red", ) points(maxtemp ~ sampdate, data=

Re: [R] Plot two values on same axes

2019-09-27 Thread Rich Shepard
On Fri, 27 Sep 2019, David Winsemius wrote: Instead of trying to mix lattice and base functions, you might try using the formula: maxtemp+mintemp ~ sampdate And then: col= c(“red”, “blue”) David, I certainly will. I've not needed R for projects for many months and when I looked through prev

Re: [R] Plot two values on same axes

2019-09-26 Thread Rolf Turner
On 27/09/19 10:27 AM, Rich Shepard wrote: I want to plot maximum and minimum water temperatures on the same axes and thought I had the correct syntax: watertemp <- read.table("../../data/hydro/water-temp.dat", header = TRUE, sep =",") watertemp$sampdate <- as.Date(as.character(watertemp$sam

Re: [R] Plot two values on same axes

2019-09-26 Thread David Winsemius
Instead of trying to mix lattice and base functions, you might try using the formula: maxtemp+mintemp ~ sampdate And then: col= c(“red”, “blue”) Sent from my iPhone, so make sure those quotes are ordinary double quotes. — David > On Sep 27, 2019, at 6:27 AM, Rich Shepard wrote: > > I wan

Re: [R] Plot historical data

2019-06-19 Thread Abby Spurdle
I'm not sure I understand exactly what you mean. > I want to EXTRACT FOR ONE HAND A TABLE WITH MEAN BY CENTER, STD DESV. Do you want a table giving the mean and sd of Cost, grouped by Center? > I want a plot or smooth plot replicating a gauss line distribution by > center. Do you want one plot

Re: [R] plot (cox)

2019-04-15 Thread Medic
Dear Sarah, everything worked out! Thank You!!! -- Sarah Goslee : > Well, you don't provide a reproducible example, so there's only so > much we can do. The help for par is a lot, but I told you which option > to use. Did you try reading the examples for ?axis at all

Re: [R] plot (cox)

2019-04-15 Thread Sarah Goslee
Well, you don't provide a reproducible example, so there's only so much we can do. The help for par is a lot, but I told you which option to use. Did you try reading the examples for ?axis at all? plot (cox, col=1:2, xscale=1, xlab="OS", ylab="Probability", xaxt="n") axis(1, at=seq(0, 48, by=12)

Re: [R] plot (cox)

2019-04-15 Thread Medic
Thanks, but too hard for me Sarah Goslee : > You can presumably use xaxt="n" in your plot() statement (see ?par for > details), and then use axis() to make anything you'd like (see ?axis > for details). -- >> Medic wrote: >> In this code: >> plot (cox, col=1:2, xsc

Re: [R] plot (cox)

2019-04-15 Thread Sarah Goslee
You can presumably use xaxt="n" in your plot() statement (see ?par for details), and then use axis() to make anything you'd like (see ?axis for details). Sarah On Mon, Apr 15, 2019 at 12:51 PM Medic wrote: > > In this code: > > plot (cox, col=1:2, xscale=1, xlab="OS", ylab="Probability") > > th

Re: [R] Plot coordinates on world map with Robinson CRS - ggplot2

2019-02-18 Thread Jeff Newmiller
This is the wrong place for this question. https://stat.ethz.ch/mailman/listinfo/r-sig-geo On February 18, 2019 12:57:38 AM PST, Miluji Sb wrote: >Dear all, > >I am trying to plot coordinates on a world map with Robinson CRS. While >the >world map is generated without any issues, when I try to p

Re: [R] [FORGED] Re: R plot split screen in uneven panels

2018-12-13 Thread Rolf Turner
On 12/14/18 1:44 AM, Luigi Marongiu wrote: Thank you, that worked good. I tried to read the help for layout/split.screen but I found it confusing. Me too. I conjecture that *everybody* finds it confusing, except maybe Paul M., and I'm not so sure about him! :-) However it *is possible*

Re: [R] Plot a matrix

2018-11-01 Thread David L Carlson
pages to understand what we are doing: ?read.table ?rownames ?as.dist ?dput ?as.numeric ?attributes ?dist ?plot ?Extract (to understand what the "$" is all about. -------- David L Carlson Department of Anthropology Texas A&M University College Station,

Re: [R] Plot a path

2018-11-01 Thread Jan van der Laan
Below a similar example, using sf and leaflet; plotting the trajectory on a background map. library(leaflet) library(sf) library(dplyr) # Generate example data gen_data <- function(id, n) { data.frame( id = id, date = 1:n, lat = runif(10, min = -90, max = 90), lon = runif(10,

Re: [R] Plot a path

2018-11-01 Thread Rui Barradas
Hello, The following uses ggplot2. First, make up a dataset, since you have not posted one. lat0 <- 38.736946 lon0 <- -9.142685 n <- 10 set.seed(1) Date <- seq(Sys.Date() - n + 1, Sys.Date(), by = "days") Lat <- lat0 + cumsum(c(0, runif(n - 1))) Lon <- lon0 + cumsum(c(0, runif(n - 1))) Place

Re: [R] Plot a matrix

2018-10-31 Thread Jim Lemon
Hi Myriam, This may not be the ideal way to do this, but I think it works: mcdf<-read.table(text="41540 41540 41442 41599 41709 41823 41806 41837 41898 41848 41442 0.001 41599 0.002 0.001 41709 0.004 0.003 0.003 41823 0.002 0.001 0.002 0.001 41806 0.004 0.004 0.005 0.006 0.005 41837 0.004 0.004 0.

Re: [R] Plot a path

2018-10-31 Thread MacQueen, Don via R-help
Probably sort the data frame by date Then plot( mydf$geogr.longitude, mydf$geogr.latitude, type='l') Search the web for some tutorials See the help pages for plot plot.default -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062

Re: [R] Plot in real unit (1:1)

2018-10-08 Thread Christian Brandstätter
Dar Jim, late, but it works now perfectly. I made a little function for autoscaling elevation data. https://stackoverflow.com/questions/50606797/plot-in-real-units-mm/52696705#52696705The (paper-)printer typically also autoscales, which needs to be deactivated. Example for a plot with scale i

Re: [R] Plot function: hourly data and x-axis

2018-08-09 Thread Jeff Newmiller
Pre-process your data into per-day or per-month records, then plot it. There are many ways to do this... for example, base R has the aggregate function, and the dplyr package has the group_by/summarise functions, and the data.table package can do this as well (read the vignettes). All of these

Re: [R] Plot function: hourly data and x-axis

2018-08-09 Thread MacQueen, Don via R-help
Normally, one turns off the x-axis tick marks and labels by supplying xaxt='n' in the plot() call, and then adds a customized x-axis using the axis() function. But without more information, little help can be provided (a vague question receives a vague answer). I'd suggest reviewing the pos

Re: [R] Plot Rclimdex or Climpact map with R

2018-07-30 Thread ouedraogo_agathe via R-help
om my Samsung Galaxy smartphone. Original message From: Jim Lemon Date: 7/31/18 02:53 (GMT+03:00) To: ouedraogo_agathe Cc: r-help mailing list Subject: Re: [R] Plot Rclimdex or Climpact map with R Hi Agathe, You can start with the "maps" package: # in an R session i

Re: [R] Plot Rclimdex or Climpact map with R

2018-07-30 Thread Jim Lemon
Hi Agathe, You can start with the "maps" package: # in an R session install.packages("maps") # assume you want a simple map containing France map("world",xlim=c(-6.0,9.6),ylim=c(42,51.5)) then plot your data by the coordinates of the stations. You will probably want to plot graphical elements to

Re: [R] Plot Rect Transparency

2018-07-27 Thread Martin Maechler
> Duncan Murdoch > on Thu, 28 Jun 2018 20:57:19 -0400 writes: > On 28/06/2018 5:29 PM, Jeff Reichman wrote: >> R-Help >> >> >> >> Is there a way to make a rectangle transparent (alpha=0.1??) >> >> >> >> plot(c(100, 200), c(300, 450), type=

Re: [R] Plot Rect Transparency

2018-06-28 Thread Jeff Reichman
28, 2018 7:57 PM To: reichm...@sbcglobal.net; R-help@r-project.org Subject: Re: [R] Plot Rect Transparency On 28/06/2018 5:29 PM, Jeff Reichman wrote: > R-Help > > > > Is there a way to make a rectangle transparent (alpha=0.1??) > > > >plot(c(100, 200), c(3

Re: [R] Plot Rect Transparency

2018-06-28 Thread Duncan Murdoch
On 28/06/2018 5:29 PM, Jeff Reichman wrote: R-Help Is there a way to make a rectangle transparent (alpha=0.1??) plot(c(100, 200), c(300, 450), type= "n", xlab = "", ylab = "") rect(110, 300, 175, 350, density = 5, border = "red") Can't figure out how to take the changepo

Re: [R] Plot in real unit (1:1)

2018-06-07 Thread Eik Vettorazzi
How about this: in2mm<-25.4 # scale factor to convert inches to mm pdf("test.pdf",width=8.3,height=11.7) pin<-par("pin") plot(c(0,pin[1]*in2mm),c(0,pin[2]*in2mm), type="n", xaxs="i", yaxs="i") lines(c(10,10),c(0,10)) text(11,5,"1 cm", adj=0) lines(c(0,40),c(20,20)) text(20,24,"4 cm") polygon(c(

Re: [R] Plot in real unit (1:1)

2018-06-06 Thread Brandstätter Christian
Thanks a lot! Jim Lemon schrieb am Do., 7. Juni 2018, 06:13: > Hi Christian, > Well, it almost worked. I suspect that the postscript device adds some > padding to account for the printable area, so with a bit of > experimentation, The following example seems to do what you want. When > I printed

  1   2   3   4   5   6   7   8   9   10   >