similar to: regular expression

Displaying 20 results from an estimated 6000 matches similar to: "regular expression"

2007 Oct 14
1
Inconsistent behavior of sQuote and dQuote
Dear all When comparing sQuote("text") and dQuote("text") on MacOS X and Linux FC4 I get an inconsistent behavior (using the new release version R-2.6.0): sQuote: On Mac I get the correct result "'text'", but on FC4 the incorrect result "`text?". dQuote: On Mac I get the correct result "\"text\"", but on FC4 the incorrect
2009 Nov 11
3
how to use # in a rd doc in url address
I am writing a rd doc, and need to use "#" in a url adress. This would make: \url{http://www.xxxx.org/myfolder/#myanchor} Of course, I suppose this will not work because # is a special character starting a comment line in the rd dialect. I did not found a similar example in "Writing R exentions". I am not sure bout using \dQuote{a quotation}), and use \sQuote and \dQuote
2008 Nov 02
5
R newbie: how to replace string/regular expression
Hello; I am a R newbie and would like to know correct and efficient method for doing string replacement. I have a large data set, where I want to replace character "M", "b", and "K" (currency in Million, Billion and K) to millions. That is 209.7B with (209.7 * 10e6) and 100.00K with (100.00 *1/100) and etc.. d <- c("120.0M", "11.01m",
2010 Oct 13
5
Regular expression to find value between brackets
Hi, this should be an easy one, but I can't figure it out. I have a vector of tests, with their units between brackets (if they have units). eg tests <- c("pH", "Assay (%)", "Impurity A(%)", "content (mg/ml)") Now I would like to hava a function where I use a test as input, and which returns the units like: f <- function (x) sub("\\)",
2009 Jul 08
5
R regular expression to extract words with the query string.
Hi, Is there a way in R to get the string which matches the expression, where the expression is a substring of the parent string. Lets say, I have $i <- "transcript:ENST0000112334 pid:ENSP000012345" What I need is the string "pid:ENSP000012345" from $i using the query "ENSP". Appreciate your comments. Praveen Surendran School of Medicine and
2010 Jul 19
3
"ACCTGMX" to "1223400" in R?
Hi, I am a newbie in R and was working on some DNA data represented as strings of A,C,T and G (also wild-character like M and X). I use the Bioconductor package in R. Currently I need to convert a string of the form "ACCTGMX" to "1223400" i.e. A is replaced by 1, C with 2, T with 3, G with 4 and any other character with a 0. I checked with 'replace' and also with a
2010 May 02
2
Retrieve regular expression groups
I'm trying to figure out how to get the text captured by capturing groups out of a regex match. For instance, let's say I have the pattern "foo ([^ ]+)" and I match it against the string "This is a foo sentence I am reading." The group in the pattern will match the word "sentence" in the target string. How can I get access to this matched group? All I
2009 Aug 25
3
Regular expression to define contents between parentheses
Hello dear R-helpers, I haven't been able to figure out of find a solution in the R-help archives about how to delete all the characters contained in groups of parenthesis. I have a vector that looks more or less like this: myvector<-c("something (80 km/h, sd) & more (6 kg/L,sd)", "somethingelse (48 m/s, sd) & moretoo (50g/L , sd)") I want to extract all
2010 Feb 08
2
the hat ^ in regular expression
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100208/52a6d080/attachment.pl>
2009 Dec 07
3
Regular expression help
Hi there I have a string like this i want to extract 9831019 from this string i used a regular expresion \d+ by which i can only make it to see 7 and returns. This type of number(9831019) appears in any part of the string and is definitely more than 5 digits all the time and i want to give that as a condition UV7C11-F9-E1 MCS#9831019 MCS Lot #9512516" how do i go abt it Ramya -- View
2009 Nov 24
1
How to interpret the name of an object literally?
Hi, I can't seem to figure out how to tell R to stop expanding an object. I would like to use the literal name rather than the expanded value. The issue occurs in a function I've been writing. The problematic part looks like this: # "fund" is a matrix of open, high, low, close, and volume prices returns <- function(fund) { p_12ago = as.vector(fund[nrow(fund)-252,6])
2009 Mar 03
4
regular expression question
can someone show me how to use a regular expression to break the string at the bottom up into its three components : (-0.791,-0.263] (-38,-1.24] (0.96,2.43] I tried to use strplit because of my regexpitis ( it's not curable. i've been to many doctors all over NYC. they tell me there's no cure ) but it doesn't work because there also dots inside the brackets. Thanks.
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
2010 Mar 31
3
regular expression help to extract specific strings from text
Dear all, Lets say I have the following: > x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at statistics that #Excel ever was! @Cain & @Able disagree though :(", "Adam: @Eve I'm sure they'll sort it out :)", "blahblah") > x [1]
2010 Feb 01
5
regular expression submatch?
What is the simplest way to extract a matched subexpression? Eg. in perl you can do "hello world" =~ m/hello (.*)/ which would return 1(true) and set $1 to the matched subexpression "world". -- View this message in context: http://n4.nabble.com/regular-expression-submatch-tp1459146p1459146.html Sent from the R help mailing list archive at Nabble.com.
2011 Mar 19
3
[O/T] reference for regular expressions
Dear R People: Could someone recommend a good reference on regular expressions, please? Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
2008 May 13
3
Regular Expressions
Hi R, Again struck with regular expressions... Suppose, S=c("World_is_beautiful", "one_two_three_four","My_book") I need to extract the last but one element of the strings. So, my output should look like: Ans=c("is","three","My") gsub() can do this...but wondering how do I give the regular expression....
2012 Feb 29
3
regular expression
Computer Friends, with the following example lines: [107] "98-610: Cell type: S; Surv(months): 6; STATUS(0=alive, 1=dead): 1" [108] "99-625: Cell type: S; Surv(months): 21; STATUS(0=alive, 1=dead): 1" i want to be able to isolate the number of months of survival for each row. is there a regular expression that can find the first instance of a ";", delete
2009 Sep 16
3
How to extract a specific substring from a string (regular expressions) ? See details inside
Hi all, I have thousands of strings like these ones: "1159_1; YP_177963; PPE FAMILY PROTEIN" "1100_13; SECRETED L-ALANINE DEHYDROGENASE ALD CAA15575" "1141_24; gi;2894249;emb;CAA17111.1; PROBABLE ISOCITRATE DEHYDROGENASE" and various others.. I'm interested to extract the code for the protein (in this example: YP_177963, CAA15575, CAA17111). I
2008 Jul 08
4
Manipulate Data (with regular expressions)
Dear Everyone, I try to automatically manipulate the data of a variable (class = factor) like x 220 220a 221 221b B221 Into two variables (class = numeric) like x y 220 0 220 1 221 0 221 1 221 1 y has to carry the information about the class (number or string) of the former x-Variable. I could do it by hand like x[x == "220a"] <- 220