search for: characterstring

Displaying 7 results from an estimated 7 matches for "characterstring".

2008 Jun 19
2
Pattern Matching Replacement
I would like to replace "\r\n" with "" in a character string, where "\r\n" exists only between < and >, how could I do that? Initial: characterString = "<XML><tag1 id=\"F\r\n2\"></t\r\nag1>\r\n<tag\r\n2></tag2></XML>" Result: characterString = "<XML><tag1 id=\"F2\"></tag1>\r\n<tag2></tag2></XML>" Tried with sub(below) but it only rep...
2008 Jan 17
2
"non-plot" plotting
I really do not know ho to else title this ... I want to draw something like the attached png with R and would like to poll you on how to start ... make an empty plot first and then start positioning the characterstring by 'text' and then drawing the lines ... Joh -------------- next part -------------- A non-text attachment was scrubbed... Name: sequence.png Type: image/png Size: 7117 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080117/a8d95d0b/attachment-0002.png
2011 Nov 08
2
match first consecutive list of capitalized words in string
...names <- c("filia Maria", "vidua Joh Dirck Kleve (oo 02.02.1732)", "Bernardus Engelb Franciscus Linde j.u.Doktor referendarius sereniss Judex et gograven Rheinensis") Is there a regular expression matching the first consecutive list of capitalized words in a single characterstring ("Maria", "Joh Dirck Kleve", "Bernardus Engelb Franciscus Linde")? This expression would very reliably seperate the person names from the additional information in my historic church register transcription. Thank you very much for your effort, Jonas ---------- This...
2013 Jan 09
1
deparse substitute
Hi, I'm writing a function that needs the input names (as characterstrings) as part of the output. With deparse(substitute( ) ) that works fine, until I replace all zeros with 0.001 (log is calculated at some time): tf <- function(input) { input[input==0] <- 0.001 ; deparse(substitute(input)) } myguess <- 42 tf(myguess) # not "myguess", but &quo...
2009 Feb 12
3
getting all pairwise combinations of elements in a character string
I'm able to do this as follows, but am wondering if anyone knows a simpler way which still avoids explicit loops? > (mystring <- letters[1:5]) [1] "a" "b" "c" "d" "e" > unlist(sapply(mystring[-length(mystring)], + function(x) paste(x,mystring[(grep(x,mystring)+1):length(mystring)],sep=""))) a1 a2 a3
2010 May 20
5
sort a data.frame
Hello,   I have a dataframe: dd <- data.frame(b = c("chr2", "chr1", "chr15", "chr13"),         x = c("A", "D", "A", "C"), y = c(8, 3, 9, 9),         z = c(1, 1, 1, 2))   >dd       b x y z 1  chr2 A 8 1 2  chr1 D 3 1 3 chr15 A 9 1 4 chr13 C 9 2 Now I want to sort them according column "b", but only its
2009 Oct 05
6
Date-Time-Stamp input method for user-specific formats
Date-Time-Stamp input method to correctly interpret user-specific formats:coding is 90% there - based on exmple at http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html ...anyone got the last 10% please? CONTEXT: Data is received where one of the columns is a datetimestamp. At midnight, the value represented as text in this column consists of just the date part, e.g.