[R] run a calculation function over time fields, ordered and grouped by variables

2015-05-25 Thread gavinr
I’ve got some transit data relating to bus stops for a GIS data set. Each row represents one stop on a route. For each record I have the start time of the route, a sequence in which a bus stops, the time the bus arrives at the first stop and the time taken to get to each of the stops from the

Re: [R] A problem with string handling to make a time duration

2015-05-05 Thread gavinr
Thanks guys. The first solution with the gsub / lapply works perfectly. The solution using substrings would work if the times were in a consistent format, but without the leading zeros and with some parts of the string absent completely it would need some extra logic to apply. I need something to

[R] A problem with string handling to make a time duration

2015-05-04 Thread gavinr
I have a character string that represents a time duration. It has an hours minutes seconds structure(ish) but with letters denoting units (H,M or S) no leading zeros and no placeholder at all where one or other of the units are not required. It looks like this: t-c(10H20M33S,1H1M,1M,21M9S,2H55S

Re: [R] Extracting xml data to data frames

2015-04-17 Thread gavinr
Hi I will re-post using dput to recreate the xml file. I will need some time to find a small enough file that demonstrates the problem. Gavin R. -- View this message in context: http://r.789695.n4.nabble.com/Extracting-xml-data-to-data-frames-tp4705964p4705981.html Sent from the R help

[R] help with encrypting a text string in a data.frame

2014-02-23 Thread gavinr
that the AES command can use, is there a way to make this simpler? #make a simple data.frame with some sample codes postcode-c(AB5 2TG,B1 8AA,TG22 4XB) df-as.data.frame(postcode) df Any help gratefully received. GavinR -- View this message in context: http://r.789695.n4.nabble.com/help

Re: [R] Create new records based on event dates in a data frame

2013-08-19 Thread gavinr
Have used the suggested solution (the second method, as it seems a bit leaner) on my real data, and it works perfectly. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Create-new-records-based-on-event-dates-in-a-data-frame-tp4673839p4674082.html Sent from the R help

Re: [R] Some problems with back to back bar plots in ggplot2

2013-07-17 Thread gavinr
Thanks, I've now got the plot I was after. No idea what the stacking warning is about, but it does not seem to compromise my output. Gavin. -- View this message in context: http://r.789695.n4.nabble.com/Some-problems-with-back-to-back-bar-plots-in-ggplot2-tp4671744p4671765.html Sent from the