Re: [R] Gather columns based on multiple columns using tidyr

2015-12-18 Thread fahad.usman
rainfall_mm= c(t(scotland_weather[c(TRUE,FALSE)]))) Which works fine...but I am looking for a tidyr solution. Regards, Fahad Usman Network Engineering | CIO | Openreach  Web: www.openreach.co.uk -Original Message- From: Ista Zahn [mailto:istaz...@gmail.com] Sent: 17 December 2015 19:

Re: [R] Gather columns based on multiple columns using tidyr

2015-12-18 Thread fahad.usman
] Sent: 17 December 2015 20:02 To: Ista Zahn; Usman,F,Fahad,BVG1C3 R Cc: r-help@r-project.org Subject: RE: [R] Gather columns based on multiple columns using tidyr Here's another approach, but it doesn't use tidy or dplyr: > Rain.col <- seq(1, 24, by=2) > Year.col <- seq(2, 24, by =2

[R] Gather columns based on multiple columns using tidyr

2015-12-17 Thread fahad.usman
Hi, Sorry for this direct approach but I am stuck with a stupid data that I would like to reformat. The datafile is location at: fileURL <- http://www.metoffice.gov.uk/pub/data/weather/uk/climate/datasets/Rainfall/ranked/Scotland.txt You can read the data by:

Re: [R] Gather columns based on multiple columns using tidyr

2015-12-17 Thread Ista Zahn
Hi Fahad, Easier than what? You didn't tell us what you tried, nor why you were unhappy with it. I'm only passingly familiar with tidyr, but I came up with library(tidyr) library(dplyr) read.table("scotland_rainfall.txt", skip = 7, header=TRUE, fill = TRUE) %>% select(-WIN, -SPR, -SUM, -AUT,

Re: [R] Gather columns based on multiple columns using tidyr

2015-12-17 Thread David L Carlson
TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ista Zahn Sent: Thursday, December 17, 2015 1:49 PM To: fahad.us...@openreach.co.uk Cc: r-help@r-project.org Subject: Re: [R] Gather columns based on multiple columns using tidyr Hi Fahad, Eas