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

Re: [R] Importing, renaming columns and exporting mulitple csv files in R

2013-09-25 Thread Jacquomo Monk
A.K. Thanks for the reply. Will give it a try... Jac -- View this message in context: http://r.789695.n4.nabble.com/Importing-renaming-columns-and-exporting-mulitple-csv-files-in-R-tp4676951p4676959.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Importing, renaming columns and exporting mulitple csv files in R

2013-09-25 Thread Jacquomo Monk
Hi All, I have 1029 *.csv files that I would like read individually into R, delete some columns and rename others, and then export individually using the original file names. I have written some script to do this for an individual file (script below), but cannot get it to loop through all the fi

Re: [R] fill Matrix quicker

2011-08-01 Thread monk
thanks a lot , that will do the trick -- View this message in context: http://r.789695.n4.nabble.com/fill-Matrix-quicker-tp3710428p3710533.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.e

[R] fill Matrix quicker

2011-08-01 Thread monk
dear all, i have a quite simple question, i want to fill up a Matrix like done in the following function, but the performance is very bad for large dimensions is there a way to do this like with apply or something similar? makeMatrix <- function(a, b,dim) { X=matrix(0,ncol=dim,nrow=dim)