search for: strapply

Displaying 20 results from an estimated 152 matches for "strapply".

2010 Mar 15
2
tcltk and R
...ast 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 gsubfn for its parsing and strapply uses tcl from the tcltk package to it speed up -- there is also an all R version of strapply but the gsubfn package as a whole still depends on tcltk whether or not the user uses tcltk or not. I was thinking of changing the Depends:tcltk of gsubfn to Sugges...
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 hint...
2010 Jul 02
3
Good Package(s) for String and URL processing?
Are there packages that allow improved String and URL processing? E.g. extract parts of a URLs such as sub-domains, top-level domain, protocols (e.g. https, http, ftp), file type based on endings, check if a URL is valid or not, etc... I am currently only using split and paste. Are there better and more efficient ways to handle strings e.g. finding sub-strings or to do pattern matching? What
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: <Anonymous> ... <Anonymous> -> switch -> sys.source -> eval -> eval -> :: Execution halted 'MyFunction'...
2010 May 05
1
extracting a matched string using regexpr
Given a text like I want to be able to extract a matched regular expression from a piece of text. this apparently works, but is pretty ugly # some html test<-"</tr><tr><th>88958</th><th>Abcdsef</th><th>67.8S</th><th>68.9\nW</th><th>26m</th>" # a pattern to extract 5 digits > pattern<-"[0-9]{5}" #
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
2008 Aug 06
2
matching problem
...tring = "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) gives me [[1]] [1] "{XX" "{YYY" "{Z" but what should I add in the code to remove the "{" in the answer Regards Tom -- View this message in context: http://www.nabble.com/matching-problem-tp18850718p18850718.htm...
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 1) memory This happens regardless of whether I run in 32- or 64-bit mode. The machine has 8 GB of RAM, so I can hardly believe that RAM i...
2010 Aug 26
5
Quick GREP challenge
> grep("f[0-9]+=", "f1=5,f22=3,", value = T) [1] "f1=5,f22=3," How do I make the line output c("f1", "f22") instead? (Actually, c(1,22) would be even better). Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Quick-GREP-challenge-tp2339486p2339486.html Sent from the R help mailing list archive at Nabble.com.
2009 Mar 13
1
search for string insider a string
Hi, sorry if it is a too stupid question, but how do I a string search in R: I have a dataframe A with A$test like: test1 bcdtestblabla2.1bla cdtestblablabla3.88blabla and I want to search for string that start with 'dtest' and ends with number and return the location of that substring and the number, so the end result would be: NA NA 3 2.1 2 3.88 I find grep can
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 'MyPackage' has no name space and is not on the search path Calls: <Anonymous> ... <Anonymous> -> switch -> sys.source -> eval -> eval -> :: Execution halted 'MyFunction'...
2010 Feb 18
3
parsing strings between [ ] in columns
Dear all, I have a data.frame with a column like the x shown below myDF<-data.frame(cbind(x=c("[[1, 0, 0], [0, 1]]", "[[1, 1, 0], [0, 1]]","[[1, 0, 0], [1, 1]]", "[[0, 0, 1], [0, 1]]"))) > myDF x 1 [[1, 0, 0], [0, 1]] 2 [[1, 1, 0], [0, 1]] 3 [[1, 0, 0], [1, 1]] 4 [[0, 0, 1], [0, 1]] As you can see my x column is composed of
2008 Oct 20
0
New verion 0.3-7 of gsubfn package
Version 0.3-7 of the gsubfn package is available on CRAN. Changes to the package are: - all known bugs have been fixed. - in gsubfn and strapply the replacement object can be a list (or a function, formula, character string or proto object, as before). In the case of a list, regexp matches are looked up in the list names and the corresponding list component used. # Example 1 - at string end replace M with e6 & G with e9 gs...
2008 Oct 20
0
New verion 0.3-7 of gsubfn package
Version 0.3-7 of the gsubfn package is available on CRAN. Changes to the package are: - all known bugs have been fixed. - in gsubfn and strapply the replacement object can be a list (or a function, formula, character string or proto object, as before). In the case of a list, regexp matches are looked up in the list names and the corresponding list component used. # Example 1 - at string end replace M with e6 & G with e9 gs...
2010 Jun 03
5
string handling
I have a data.frame as the following: var1 var2 9G/G09 abd89C/T90 10A/T9 32C/C 90G/G A/A . . . . . . 10T/C 00G/G90 What I want is to get the letters which are on the left and right of '/'. for example, for "9G/G09", I only want "G", "G", and for "abd89C/T90", I only want "C" and
2009 Oct 26
1
regular expressions
...2.3 23.4 3.1415 All the lines containing "START" have the same number of fields, but this number may vary from file to file. I have managed to get this minimal example work, but I am at a loss as for handling an arbitrary number of couples (text value), library(gsubfn) ( parsed = strapply(st, "^START +([[:alnum:]]+) +([0-9.]+) +([[:alnum:]]+) +([0-9.]+)",c, simplify=rbind,combine=c) ) d = data.frame(parsed[ ,c(2,4)]) names(d) <- apply(parsed[ ,c(1,3)], 2, unique) d ## this one has more fields: how do I generalize the regular expression? st2 = c("START text1 1 tex...
2011 Feb 01
3
R string help
Dear R guru: If I got a variable aaa<- "up.6.11(16)" how can I extract 16 out of the bracket? I could use substr, e.g. substr(aaa, start=1, stop=2) [1] "up" But it needs start and stop, what if my start or stop is not fixed, I just want the number inside the bracket, how can I achieve this? Many thanks yan
2006 Jul 23
3
RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences
Dear all I use R for Windows 2.3.1 on a fully updated Windows XP Home SP2 machine and I have two related regular expression problems. platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor
2012 Mar 07
3
GPS handling libraries or (String manipulation)
Dear all, I would like to ask you if R has a library that can work with different GPS formats For example  I have a string of this format N50° 47.513 E006° 03.985 and I would like to convert to GPS decimal format. that means for example converting the part N50° 47.513 to 50 + 47/60 + 513/3600. Is it possible to do that with R? What is the name of such a library? I would like to thank you in
2008 Apr 09
11
Number of words in a string
Hi R, A quick question: How do we find the number of words in a string? Example: C="Have a nice day" And the number of words should be 4. any built in function or?... Thanks, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-mail may contain