Re: [R] readxl question

2020-08-26 Thread Upton, Stephen (Steve) (CIV)
>From your example, it appears you are reading in the same excel file for each function to get a value. I would look at creating a function that extracts what you need from each file all at once, rather than separate reads. Stephen C. Upton SEED (Simulation Experiments & Efficient Designs) Center

Re: [R] Help with a third ggplot error

2019-06-17 Thread Upton, Stephen (Steve) (CIV)
And slightly differently with strcapture (using Jim Lemon's reprex): mydf <- strcapture("([a-zA-Z ]+)([0-9]+\\.[0-9]+)",scdf$V1,data.frame(Channel="none",Price=0)) change the regex as needed, following Boris' advice. steve On 6/17/19, 5:09 AM, "R-help on behalf of Boris Steipe" wrote:

Re: [R] Special characters in regular expressions

2015-09-24 Thread Upton, Stephen (Steve) (CIV)
and a somewhat convoluted solution, if A or K are always in the second "position" x <- c("LBAM 5|A|15C|3h", "LBAM 5|K|15C|2h") unlist(lapply(strsplit(x,"\\|"),function(y) paste(y[c(1,3,4)],collapse="|"))) Stephen C. Upton SEED (Simulation Experiments & Efficient Designs) Center Operations

Re: [R] Hep with regex! - combination of ^, |, \\, _ and $

2015-09-18 Thread Upton, Stephen (Steve) (CIV)
And unless I'm mistaken, escaping the underscore is superfluous (I'd be curious to know if it's a function of locale). x[grep("_", x)] x[grep("^q10.*_1$", x)] both work. steve Stephen C. Upton SEED (Simulation Experiments & Efficient Designs) Center Operations Research Department Naval

Re: [R] Calculating euclidean distance in R

2013-09-27 Thread Upton, Stephen (Steve) (CIV)
?read.csv to read your data in, then ?dist to calculate distances. steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Debasish Sahu Sent: Friday, September 27, 2013 12:26 AM To: r-help@r-project.org Subject: [R] Calculating

Re: [R] file path

2012-05-10 Thread Upton, Stephen (Steve) (CIV)
Why not just construct a valid file name and use that in cat? You can then use file.path to join paths together if you want to write to a specific location, as in your example. steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] newbie xml parsing question

2011-05-31 Thread Upton, Stephen (Steve) (CIV)
?getNodeSet may help steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eric Sent: Saturday, May 28, 2011 5:03 PM To: r-help@r-project.org Subject: [R] newbie xml parsing question I am trying to read some data off the zillow

Re: [R] split string into individual valus while reading in R

2011-04-13 Thread Upton, Stephen (Steve) (CIV)
Hi Ram, Try this on your V4: d - yourdf$V4 unlist(lapply(1:nchar(d),function(x) substr(d,x,x))) HTH steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ram H. Sharma Sent: Wednesday, April 13, 2011 7:34 AM To: