Re: [R] Syntax help for 'Pivot_longer'

2021-11-29 Thread Philip Monk
es, Philip On Mon, 29 Nov 2021 at 00:31, Jeff Newmiller wrote: > > This "data_long" appears to be a mess you are not satisfied with, rather than > the "data" you started with or a model of what you want. > > On November 28, 2021 9:06:54 AM PST, Philip

Re: [R] Syntax help for 'Pivot_longer'

2021-11-28 Thread Philip Monk
ometimes seen, legalistically correctly I think, as outside the remit of > this Email list) but I agree > that the help for pivot_longer() and many other tidyverse functions is not as > good as it could be particularly > for people new to R. Often there is better documentation in vignettes

[R] Syntax help for 'Pivot_longer'

2021-11-28 Thread Philip Monk
Hello, I have a wide table that I transform to a long table for analysis. The wide table has 25 columns - the first is labels, then columns 2:25 are monthly data of LST which is in 19 rows. I mutate this with : data_long <- data %>% pivot_longer(cols = 2:25, names_to =

Re: [R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-20 Thread Philip Monk
aving 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 Sat, Nov 20, 2021 at 12:23 PM Philip Monk wrote: > > > > Thanks, Andrew. I didn't realise as

Re: [R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-20 Thread Philip Monk
something like: > > > > > >x <- c("28/10/2016", "19/11/2016", "31/12/2016", "16/01/2016", "05/03/2017") > >as.Date(x, format = "%d/%m/%Y") > > > > > >which produces this output: > &

Re: [R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-20 Thread Philip Monk
quot;19/11/2016", "31/12/2016", "16/01/2016", "05/03/2017") > > as.Date(x, format = "%d/%m/%Y") > [1] "2016-10-28" "2016-11-19" "2016-12-31" "2016-01-16" "2017-03-05" > > > > > mu

Re: [R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-20 Thread Philip Monk
5603507272.3722267991.995863839 On Sat, 20 Nov 2021 at 17:08, Philip Monk wrote: > > Hello, > > Simple but infuriating problem. > > Reading in CSV of data using : > > ``` > # CSV file has column headers with date of scene capture in format dd/mm/ > # c

[R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-20 Thread Philip Monk
Hello, Simple but infuriating problem. Reading in CSV of data using : ``` # CSV file has column headers with date of scene capture in format dd/mm/ # check.names = FALSE averts R incorrectly processing dates due to '/' data <- read.csv("C:/R_data/Bungala (b2000) julian.csv", check.names = FA

[R] Dates as headers causing confusion but needed to convert to Julian days for ANOVA

2021-10-25 Thread Philip Monk
Hello, First post - apologies if I get anything wrong - either in describing the question (I've only been using R for a week) or etiquette. I have CSV files of Land Surface Temperature (LST) data derived from Landsat 8 data and exported from Google Earth Engine. I am investigating whether the co