Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jeff Newmiller
Bill pointed out some errors in your code but you keep making the claim that -MM-DD is not recognized and I just want to make it completely clear that that is the default format for dates in R as it is an ISO standard. So focus on other issues until you get it working... this format is defin

Re: [R] A question on substitute()

2020-12-13 Thread Bert Gunter
Please disregard my previous post. My understanding is correct, and the behavior is **AS DOCUMENTED**. I failed to read the docs carefully. Mea Culpa. Best, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley

[R] A question on substitute()

2020-12-13 Thread Bert Gunter
I would appreciate any help in correcting my misunderstanding of the following: > substitute(quote(x+a), env = list(a=5)) quote(x + 5) ## as expected > substitute(quote(x+a), env = list2env(list(a=5))) quote(x + 5) ## as expected > ### BUT > .GlobalEnv$a [1] 5 > substitute(quote(x+a), env = .Gl

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jim Lemon
Hi Gregory, On Mon, Dec 14, 2020 at 12:34 PM Gregory Coats wrote: >... > Is there a convenient way to tell R to interpret “2020-12-13” as a date? > Notice the as.Date command in the code I sent to you. this converts a string to a date with a resolution of one day. If you want a higher time resolu

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Bill Dunlap
You left out some calls to c(). Note that (2,3,5) is not valid syntax for making a vector of numbers; use c(2,3,5) You also left out a comma and gave different lengths for day and value. You also left out plus signs between the various components of your ggplot expression. Try data <- data

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Gregory Coats via R-help
Hi Jim, Thank you VERY much! In what I tried, my values for the vertical Y were automatically understood by R. But it appears that the string -mm-dd was NOT recognized by R as a date for the X axis, and gave a red error message. My values for Year-Month-Day were NOT understood by R. Is there

Re: [R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread Brian Beckage
David, Great suggestion! Thanks, Brian On Dec 13, 2020, at 6:06 PM, David Winsemius mailto:dwinsem...@comcast.net>> wrote: On 12/13/20 12:49 PM, Brian Beckage wrote: As an example to illustrate my question, if I used the following code to plot the price of Apple stock using the tidyquan

Re: [R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread Daniel Nordlund
On 12/13/2020 12:49 PM, Brian Beckage wrote: As an example to illustrate my question, if I used the following code to plot the price of Apple stock using the tidyquant package and ggplot2 AAPL<-tq_get(x="AAPL") AAPL %>% ggplot(aes(x = date, y = close)) + geom_line() + labs(title = "A

Re: [R] multiple t-test with different species and treatments

2020-12-13 Thread Bert Gunter
1. Please read and follow the posting guide linked below. 2. No html -- this is a plain text list. 3. Use ?dput to provide us your data so that we don't have to convert it for you. 4. We expect you to first make an effort to do your own coding. See ?t.test, which you could also have found yourself

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jeff Newmiller
By converting the character date data into a time-like type... e.g. ?as.Date and plotting y-vs-x. On December 12, 2020 11:18:46 AM PST, Gregory Coats via R-help wrote: >Starting with year-month-day, for the variable gallons, I can easily >plot the variable gallons, while disregarding the date.

Re: [R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread David Winsemius
On 12/13/20 12:49 PM, Brian Beckage wrote: As an example to illustrate my question, if I used the following code to plot the price of Apple stock using the tidyquant package and ggplot2 AAPL<-tq_get(x="AAPL") AAPL %>% ggplot(aes(x = date, y = close)) + geom_line() + labs(title = "A

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jim Lemon
Hi Gregory, Here's a start: gcdf<-read.table(text="2020-01-05 15.973 2020-02-15 18.832 2020-03-10 17.392 2020-05-04 14.774 2020-06-21 19.248 2020-08-01 14.913 2020-08-27 15.226 2020-09-28 14.338 2020-11-09 18.777 2020-12-11 19.652", header=TRUE,stringsAsFactors=FALSE, col.names=c("date","gallons")

[R] multiple t-test with different species and treatments

2020-12-13 Thread Lingling Wen
Dear R users, I would like to ask for help with the code of multiple t-test. I have a dataset as followed: Species Treatment var1 var2 var2 var4 var5 var6 Blue D 0.022620093 0.125079631 0.04522571 0.010105835 0.013418019 1.455646741 Blue D 0.02117295 0.073544277 0.0311234 0.008742305 0.03261776 0.9

[R] How to specify year-month-day for a plot

2020-12-13 Thread Gregory Coats via R-help
Starting with year-month-day, for the variable gallons, I can easily plot the variable gallons, while disregarding the date. gallons <- c (15.973, 18.832, 17.392, 14.774, 19.248, 14.913, 15.226, 14.338, 18.777, 19.652) plot (gallons, type="l", xlab="X label", ylab="Y label", col="blue”) How do

[R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread Brian Beckage
As an example to illustrate my question, if I used the following code to plot the price of Apple stock using the tidyquant package and ggplot2 AAPL<-tq_get(x="AAPL") AAPL %>% ggplot(aes(x = date, y = close)) + geom_line() + labs(title = "AAPL", y = "Closing Price", x = "") + coord_x_dat