Displaying 4 results from an estimated 4 matches for "repstr".
Did you mean:
refstr
2010 Mar 29
3
one way to write scripts in R
...{
# detect trailing split : and add "" afterwards, so we know if it was
there.
a=strsplit(pp(x,"|@|@|"),split,...)
lapply(a,function(x) gsub("|@|@|","",x,fixed=TRUE))
}
strsplit3=function(x,split,keepsplit=FALSE,...) {
if (keepsplit) {
repstring="34HERE43"
if (length(grep(repstring,x))) { die(repstring, " repstring already
found. Arg! Aborting") } # sanity check
# note where we want to split, using \\1 backref to keep the original
a=gsub(pattern=pp("(",split,")") ,replacement=pp...
2018 Feb 13
0
Help with regular expressions
Hi Dennis,
How about:
# define the two values to search for
x<-2
y<-3
# create your search string and replacement string
repstring<-paste(x,y,sep=",")
newstring<-paste(x,y,sep=".")
# this is the string that you want to change
thetastring<-"SIGMA(2,3)"
sub(repstring,newstring,thetastring)
[1] "SIGMA(2.3)"
Use gsub if you want to change multiple values
Jim
On Tue, Feb 13, 20...
2018 Feb 13
1
Help with regular expressions
...abc 1.1 ,1 1, x,y 2.3 "
B.
> On Feb 12, 2018, at 9:34 PM, Jim Lemon <drjimlemon at gmail.com> wrote:
>
> Hi Dennis,
> How about:
>
>
> # define the two values to search for
> x<-2
> y<-3
> # create your search string and replacement string
> repstring<-paste(x,y,sep=",")
> newstring<-paste(x,y,sep=".")
> # this is the string that you want to change
> thetastring<-"SIGMA(2,3)"
> sub(repstring,newstring,thetastring)
> [1] "SIGMA(2.3)"
>
> Use gsub if you want to change multi...
2018 Feb 13
3
Help with regular expressions
R 3.4.2
OS X
Colleagues
I would appreciate some help with regular expressions.
I have string that looks like:
" ITERATION ,THETA1 ,THETA2 ,THETA3 ,THETA4 ,THETA5 ,THETA6 ,THETA7 ,SIGMA(1,1) ,SIGMA(2,1) ,SIGMA(2,2)?
In the entries that