similar to: quotes

Displaying 20 results from an estimated 30000 matches similar to: "quotes"

2003 Aug 12
3
grep and gsub on backslash and quotes
The following code works, to gsub single quotes to double quotes: line <- gsub("'", '"', line) (that's a single quote within doubles then a double within singles if your viewer's font is not good). But The R Language Manual tells me that Quotes and other special characters within strings are specified using escape sequences: \' single quote \"
2004 Aug 27
3
gsub, backslash and xtable
R Version 1.9.1 (2004-06-21) Mac OS X.3.5 Dual 2GHz PowerPC G5 GUI = "AQUA" I have a data.frame comprising percentiles with the column headings containing % characters, e.g. > (pp <- colnames(temp2)) [1] "5%" "10%" "25%" "50%" "75%" "90%" "95%" I use xtable to convert the data.frame to Latex but I want to
2002 Jan 02
1
Combining files
Hi: I am a very recent user of R 1.40 for MacOSX and went through the help files but did not not find the function that I am looking for. I have two comma separated files which I want to partly combine. File 1 has 49670 lines and 26 columns (separated by commas) and looks like this: ...
2006 Feb 01
3
inserting one backslash
Hello, I am not very familiar with regular expressions and escaping. I need to replace the %-signs in a character vector with elements as "income 0%-33%# to be replaced by "income 0\%-33\%" (for later use in LaTeX). Using gsub("%","\\%","income 0%-33%") does not give the desired result. However, gsub("%","\\\\%","income
2011 Jul 17
3
gsub() with unicode and escape character
Dear helpers, I'm trying to replace a character with a unicode code inside a data frame using gsub(), but unsuccessfully. > data.frame(animals=c("dog","wolf","cat"))->my.data > gsub("o","\u0254",my.data$animals)->my.data$animals > my.data$animals [1] "d??g" "w??lf" "cat" It's not that a data
2011 Nov 04
3
replace double backslash with singel backslash
I want to replace \\ with \ in: str <- "C:\\DOKUME~1\\u0327336\\LOKALE~1\\Temp\\RtmpQ5NJ8X\\TIRIS_PICS\\1_Img.jpg" and tried: gsub("\\\\", "\\", str) but this removes the \\ without replacing them by \ Any help much appreciated, Kay ----- ------------------------ Kay Cichini Postgraduate student Institute of Botany Univ. of Innsbruck ------------------------
2012 Dec 17
2
Formatting a path for unix with gsub
I have a path: path = "/nfs/users/nfs_n/ns9/ Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll trained without akapn+tnik.csv" I wish to replace the spaces with "\ " so that it can be read by a system call to unix. Using gsub I try: > gsub(" ","\\ ",path) [1] "/nfs/users/nfs_n/ns9/Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll
2011 Aug 30
2
url prep function (backslash issue)
Greeting R Community, I am a windows user so this problem may be specific to windows. I often want to source files from within R such as: C:\Users\Rinker\Desktop\Research & Law\Data\School Data 09-10. To source this file I need to go through the path and replace all the backslashes (\) with forward slashes (/). I usually do this in MS Word using the replace option, however, I'd like
2008 Jul 06
2
Regular expressions: bug or misunderstanding?
I'm trying to write a gsub() call that takes a string and escapes all the unescaped quote marks in it. So the string \" would be left unchanged, but \\" would be changed to \\\" because the double backslash doesn't act as an escape for the quote, the first just escapes the second. I have the usual problems of writing regular expressions involving backslashes which
2011 Apr 29
1
regular expression in gsub() for strings with leading backslash
Hello, Can anyone help on gsub() in R? I have a string like something below, and wanted to delete all the strings with leading backslash, including "\xa0On", "\023, "\xab", and many others. How should I write a regular expression pattern in gsub()? I don't care how many characters following backslash. txt <- "Is This Thing\xa0On? http://bit.ly/jAbKem
2012 Jan 24
1
gsub semicolon with double quotation mark
Hi, I would like to substitute a semicolon with two double quotation marks and a comma inbetween. It suppose to look like that: I have: FBpp0070086;FBpp0099643;FBpp0112915 I would like to have: "FBpp0070086","FBpp0099643","FBpp0112915" I tried with various numbers of backslashes, but noe have worked. for example: gsub(";", "\\\",\"",
2012 Mar 07
1
gsub: replacing double backslashes with single backslash
Hello everybody, this might be a trivial question, but I have been unable to find this using Google. I am trying to replace double backslashes with single backslashes using gsub. There seems to be some unexpected behaviour with regards to the replacement string "\\". The following example uses the string C:\\ which should be converted to C:\ . > gsub("\\\\",
2009 Jan 21
1
Bug in sub and gsub (PR#13460)
Full_Name: Leon C. Banza Version: 2.8.1 OS: Windows Vista Submission from: (NULL) (195.69.243.253) I believe there is a serious bug in the code for sub and gsub. I do as following: gsub("\\", "-", "some\\backslashed\\string") This ought return "some-backslashed-string", but prints warnings instead: Error in sub("\\", "",
2009 Apr 03
2
Removing backslashes from data
I am trying to check for backslashes in data, then remove them when I find them, but am having a difficult time figuring out the best way to do it. I know the backslash is the escape character in R, and I should be able to use 'gsub' to accomplish this, but I all I seem to be getting are errors. For example: If entry is: "Hello\World" I want: "HelloWorld"
2003 Sep 09
2
Making R packages (Unix)
Hi: I have have taken over from a colleague who prepared an R package and failed to build it on Windows. I am doing this with unix as I am a mac user. Below is the output I get when I use the build command: [gattuso:unix/R/CO2.Rcheck] gattuso% R CMD build CO2 * checking for file 'CO2/DESCRIPTION' ... OK * preparing 'CO2': * checking whether 'INDEX' is up-to-date ...
2003 Sep 09
6
Making R packages
Hi: I am posting this message for a colleague who has a lot of trouble to build an R package on Windows. He did not find a solution to his problems on the R-help archives and hopes that one of the R gurus will be able to help. He has a directory "CO2" which should contain all the required files and directories: DATA: DESCRIPTION MAN: R: README SRC: The following command is
2011 May 05
1
Using GSUB to obtain a printing "\"
Hello. I'd like to be able to print variable strings which contain "\" as-is, without interpreting (for example) "abcde\nuvxyz" as having an embedded newline (or whatever other escaped instruction). To do this, I've tried gsub, and here's some of my output (I've tried all kinds of variations to the arguments): >
2004 Nov 29
4
escaping backslash in a string
How can I get a single backslash in a character string? My goal is to escape dots in a string that will be used as a regular expression. I thought I could do it this way: gsub(".", "\\.", x) Unfortunately, "\\" does not represent a literal backslash as I expected, but rather a pair of backslashes: > "\\." [1] "\\." > "\\" [1]
2002 Aug 19
2
Help with Lattice
Hi: I have started to use Lattice two days ago and find that it is an outstanding package. I am, however, stumbling on two problems, despite the fact that I have read the help pages as well as two pdf documents on Trellis that I found on the web. 1- I want to remove the ticks on the top and right sides of the panels and did not see any option in "scales" to do so. 2- I would like
2002 Jan 18
2
length of dimnames???
Hi: I have made a lot of progress reading and manipulating large data files, thanks to the help of several of you. I am now stuck with writing the final file with the following error (see also the full transcript below): Error in as.matrix.data.frame(x) : length of dimnames[2] not equal to array extent I do not know what it means and could not find how to get around that in the manual nor