Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread Christofer Bogaso
Hi, I just provided a snapshot of my CSV file. Attaching the full file here (not sure if R-help would accept the attachment). Thanks and regards, On Thu, Aug 3, 2023 at 8:35 PM Jeff Newmiller wrote: > > no commas? > > On August 3, 2023 7:53:07 AM PDT, Christofer Bogaso > wrote: > >Hi, > > >

Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread Gabor Grothendieck
The header has white space in it so skip over it, use header = FALSE and specify the column headers yourself. Also use fill=TRUE since the first row does not have 3 entries. # generate test file cat("Date Adj Close lret 02-01-1997 737.01 03-01-1997 748.03 1.48416235 06-01-1997 747.65

Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread John Kane
One reason seems to be you are saying sep = "," and there is no "," in the file. Also you only have 3 columns of data but 4 variable names. On Thu, 3 Aug 2023 at 10:53, Christofer Bogaso wrote: > Hi, > > I have a CSV which contains data like below (only first few rows), > > Date Adj Close lret

Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread Stephen H. Dawson, DSL via R-help
Agreed. Tab character is not comma character. *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com On 8/3/23 11:04, Jeff Newmiller wrote: no commas? On August 3, 2023 7:53:07 AM PDT, Christofer Bogaso wrote: Hi, I have a

Re: [R] Could not read time series data using read.zoo()

2023-08-03 Thread Jeff Newmiller
no commas? On August 3, 2023 7:53:07 AM PDT, Christofer Bogaso wrote: >Hi, > >I have a CSV which contains data like below (only first few rows), > >Date Adj Close lret >02-01-1997 737.01 >03-01-1997 748.03 1.48416235 >06-01-1997 747.65 -0.050813009 >07-01-1997 753.23 0.743567202 >08-01-1997

[R] Could not read time series data using read.zoo()

2023-08-03 Thread Christofer Bogaso
Hi, I have a CSV which contains data like below (only first few rows), Date Adj Close lret 02-01-1997 737.01 03-01-1997 748.03 1.48416235 06-01-1997 747.65 -0.050813009 07-01-1997 753.23 0.743567202 08-01-1997 748.41 -0.64196699 09-01-1997 754.85 0.856809786 10-01-1997 759.5 0.614126802 However

Re: [R] Choosing colours for lines in ggplot2

2023-08-03 Thread Kimmo Elo
Hi, when using 'scale_colours_manual' the colours must be defined as value- color pairs (i.e. "A"="red", "B"="blue" an so on). If you read the documentation it is recommended to use a named vector. If I understood it correctly, in your code #2 R understood the variable "Stat" as a number (i.e.