Displaying 20 results from an estimated 4000 matches similar to: "New verion 0.3-7 of gsubfn package"
2008 Oct 28
1
gsubfn, strapply, REGEX Problem
Hi all,
I swear this used to work:
library(gsubfn)
strapply("S(AC,P)TVDK(8)EELVQK(8), ".[(].{1,2}[)]|.")[[1]]
But somewhere along the update path it stopped ... now giving me this
Error in base::gsub(pattern, rs, x, ...) :
invalid backreference 2 in regular expression
Can't figure it out. What am I doing wrong?
Thanks for any hints, Joh
2010 Mar 15
2
tcltk and R
I have had some comments on sqldf regarding its dependence on tcltk
such as the second last sentence on this blog post:
http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://www.wentrue.net/blog/%3Fp%3D453&prev=http://blogsearch.google.com/blogsearch%3Fhl%3Den%26ie%3DUTF-8%26q%3Dsqldf%26lr%3D%26sa%3DN%26start%3D10
sqldf does not directly use tcltk but it does use strapply in
2008 Aug 06
2
matching problem
I have a matching problem that I cant solve.
mystring = "xxx{XX}yy{YYY}zzz{Z}" where "x","X","y","Y","z","Z" basiclly can
be anything, letters, digits etc. I'm only interested in the content within
each "{}".
I am close but not really there yet.
library(gsubfn)
strapply(mystring,"\\{[^\\}]+",, perl=F)
2006 Mar 28
0
New package gsubfn
gsubfn is a package with one function, gsubfn, that
is like gsub except instead of taking a replacement
string it takes a replacement function. For each
match, that match is passed to the replacement
function along with the backreferences, if any,
and replaced with the output of the function.
If the first two arguments are omitted the defaults
are set to do perl-style (sort of) string
2006 Mar 28
0
New package gsubfn
gsubfn is a package with one function, gsubfn, that
is like gsub except instead of taking a replacement
string it takes a replacement function. For each
match, that match is passed to the replacement
function along with the backreferences, if any,
and replaced with the output of the function.
If the first two arguments are omitted the defaults
are set to do perl-style (sort of) string
2008 Jan 23
1
Package Building and Name Space
Hello,
I just don't get this and would appreciate if someone could write a line or
two: I'm trying to build this package and it stops installing after I add
the following to the NAMESPACES file:
>importFrom(gsubfn,strapply)
The error during the package test is:
Error in MyPackage::MyFunction :
package 'MyPackage' has no name space and is not on the search path
Calls:
2008 Jan 23
1
Package Building and Name Space
... sorry for reposting this in a more appropriate forum than r.general ...
Hello,
I just don't get this and would appreciate if someone could write a line or
two: I'm trying to build this package and it stops installing after I add
the following to the NAMESPACES file:
>importFrom(gsubfn,strapply)
The error during the package test is:
Error in MyPackage::MyFunction :
package
2010 May 18
2
Function that is giving me a headache- any help appreciated (automatic read )
note: whole function is below- I am sure I am doing something silly.
when I use it like USGS(input="precipitation") it is choking on the
precip.1 <- subset(DF, precipitation!="NA")
b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip <- precip.1
DF.precip$precipitation <- b$.data
part, but runs fine outside of the function:
days=7
2010 Mar 16
0
FW: How to parse a string (by a "new" markup) with R ?
A version using regular expressions, regexpr() and substr() functions is attached.
Finally everything is packed into splitSeq() function (chunk 14 in the attached file)
Seq<- "GCCTCGATAGCTCAGTTGGGAGAGCGTACGACTGAAGATCGTAAGGtCACCAGTTCGATCCTGGTTCGGGGCA"
Str<-
2009 Oct 06
1
ggplot2 applying a function based on facet
Look at the bottom of the message for my question
#here is a little function that I wrote
USGS <- function(input="discharge", days=7){
library(chron)
library(gsubfn)
#021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS)
#02102908 is the Flat Creek Gauge (ftbrfcms)
#02133500 is the Drowning Creek (ftbrbmcm)
#02341800 is the Upatoi Creek Near Columbus (ftbn)
#02342500 is
2009 Oct 26
1
regular expressions
Dear list,
I have the following text to parse (originating from readLines as some
lines have unequal size),
st = c("START text1 1 text2 2.3", "whatever intermediate text", "START
text1 23.4 text2 3.1415")
from which I'd like to extract the lines starting with "START", and
group the subsequent fields in a data.frame in this format:
text1 text2
2009 Nov 18
2
parsing numeric values
Dear list,
I'm seeking advice to extract some numeric values from a log file
created by an external program. Consider the following example,
input <-
readLines(textConnection(
"some text
<ax> = 1.3770E-03 <bx> = 3.4644E-07
<ay> = 1.9412E-04 <by> = 4.8840E-08
other text
<aax> = 1.3770E-03 <bbx> = 3.4644E-07
2008 Aug 01
1
chron objects: input/output
Hi list, I have some questions regarding
1) conversion of date + time characters to chron
2) formatting chron object printing
Regarding (1), Gabor's Rnews 2004 4/1 article has been indispensible,
but I often work with files where dates and times are contained in a
single field. In this case, I would like to control input/output of
chron objects when each observation of date and time is
2008 Nov 02
1
Wishlist: pass args from demo() to source()
Currently demo calls source with a hard coded max.deparse.length = 250
so you can't really see the demo properly in some cases. Note the
[TRUNCATED] below. (1) It would be nice if demo passed max.deparse.length
(and other args to source). (2) Also a larger max.deparse.length default would
be nice to make it less likely one would have to set it in the first place.
> R.version.string #
2008 Aug 12
2
perl expression question
I have a string such as
fileName<-"Agg.20.20.20-all-01".
All I want to do is pull the "20.20.20" and the "all" as strings.
Obviously, they aren't always those values.
The "20.20.20" can be "30.30.30" but it's always after the . which is
next to the second g in Agg and it's always the same length. The all
might not always be
2009 May 26
1
passing "..." arguments to a function called by eval()
Hi everyone,
I am starting learn to call C code from within R. So far, I've been
trying toy problems to see if I can get them to work. One of the things
I'd like to do is pass an arbitrary R function to C, evaluate the value
in the C code using eval, and then return it. I also want to allow an
arbitrary number of arguments to the function using "...".
The code for my toy
2006 Oct 18
1
how to manipulate counts matrix?
Hi List,
I've got a count matrix like this:
[-11.9,-11] (-11,-10.2] (-10.2,-9.3] (-9.3,-8.44]
[-11.9,-10.6] 0 0 0 0
(-10.6,-9.3] 0 0 0 0
(-9.3,-8.01] 0 0 0 0
(-8.01,-6.73] 0 0 0 0
I want to
2013 Jun 04
0
[PATCH] Btrfs-progs: fix incorrect root backref errors in fsck
A user reported that fsck was complaining about unresolved refs for some
snapshots. You can reproduce this by doing
mkfs.btrfs /dev/sdb
mount /dev/sdb /mnt
btrfs subvol snap /mnt/ /mnt/a
btrfs subvol snap /mnt/ /mnt/b
btrfs subvol del /mnt/a
umount /mnt
btrfsck /dev/sdb
and you''d get this
unresolved ref root 258 dir 256 index 2 namelen 1 name a error 600
because snapshot b has a dir
2009 Nov 03
2
R 2.10.0: Error in gsub/calloc
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this
is a Mac-specific problem.
I have a very large (158,908 possible sentences, ca. 58 MB) plain text
document d which I am
trying to tokenize: t <- strapply(d, "\\w+", perl = T). I am
encountering the following error:
Error in base::gsub(pattern, rs, x, ...) :
Calloc could not allocate (-1398215180 of
2006 Nov 29
1
Extract some character from a character vector of length 1
the content of th character vector (of length 1) is as follows:
a <- "something2 ....pat1 name1 pat2 something2....pat1 name2
pat2....pat1 name3 pat2 "
I would like to extract the character bewteen pat1 and pat2. That's to
say, I would like to get a vecter of c("name1", "name2","name3").
What I did is use strsplit() twise. But I wonder if there