>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
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:
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
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
?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
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
?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
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:
8 matches
Mail list logo