search for: backslashing

Displaying 20 results from an estimated 1085 matches for "backslashing".

2008 May 09
4
Gnome-terminal's backslashes look like Ws with a horizontal line through -- how to get a backslash?
Hello! I've just started trying gnome-terminal (instead of xterm) because of its "tabbing" facility. However, I note that with it backslashes appear something like a W with a horizontal line through it. Any known way to get a backslash to appear as a backslash? To see what I mean, use gnome-terminal with echo '\' in bash, ksh, etc. Regards, Chip Campbell
2024 Apr 11
3
Regexp pattern but fixed replacement?
I noticed this issue in stringr::str_replace, but it also affects sub() in base R. If the pattern in a call to one of these needs to be a regular expression, then backslashes in the replacement text are treated specially. For example, gsub("a|b", "\\", "abcdef") gives "def", not "\\\\def" as I wanted. To get the latter, I need to escape
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 Aug 07
2
xtable, sweave and resizebox
does anyone know to rezize a table produzed by xtable? The size of my table is too big and I would like to resize it like using resizebox but it gives an erros when I try using it using it its fine \SweaveOpts{echo=false} <<results=tex>>= xtable(stats0,caption='Número de transacções dos artigos frequentes e infrequentes',label='tab:INEStats') @ but the size is too
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 ------------------------
2004 Nov 30
3
Problem with print() and backslashes.
Dear R List I have a small problem concerning the output of print(). My version: > R.version _ platform i386-portbld-freebsd5.2 arch i386 os freebsd5.2 system i386, freebsd5.2 status major 1 minor 9.0 year 2004 month 04 day 12 language R Consider this: I want to print a backslash with an exclamation mark. Here is the output. > print( "\!"
2020 May 15
3
edit() doubles backslashes when keep.source=TRUE
Is it just my installation or does edit() (or fix(), etc.) in R-4.0.0 double all the backslashes when options(keep.source=TRUE)? E.g., > options(keep.source=TRUE) > f <- function(x) { cat("\t", x, "\n", sep="") } > edit(f) # exit the editor without making any changes The editor (vi or notepad) shows doubled backslashes function(x) {
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"
2007 Apr 27
1
Problem with formatted xtable in R 2.5.0
Dear R-Devel subscriber, I encountered the following problem for tex-formatted table with xtable(). Suppose I do want the following matrix as a table in LaTeX: library(xtable) a11 <- "\\color{green}\\textbf{big green}" a21 <- "\\color{red}\\textbf{big red}" a12 <- "\\color{green}green" a22 <- "\\color{red}red" A <- matrix(c(a11, a21, a12,
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
2009 Apr 22
1
Upgrading from 1.4.21.2 to 1.6.0.5 breaks sql queries with backslashes?
Hi, all. I've been searching google, bug reports and forums and have looked in all the asterisk-users list archives back to 2003 but haven't seen an answer to this, so thought I'd post here. The problem seems to be that Asterisk 1.6.0.5 is sending backslashes (needed to escape commas and so forth in 1.4.21.2) as *literal* backslashes to Mysql, so that Mysql gives a syntax error
2008 Aug 04
3
backslash in character string?
Dear list, After searching many old posts, I can't find the solution to a simple problem. can someone tell me how to create a character string with multiple backslashes, as in: file_dir <- c("C:\files\data\") I need to create this string and then paste it to many files names for batch processing in another software program. R won't accept the backslash and removes
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 \"
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
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
2006 Jan 05
1
How do I get sub to insert a single backslash?
Something about the way R processes backslashes is defeating me. Perhaps this is because I have only just started using R for text processing. I would like to change occurrences of the ampersand & into ampersand preceded by a backslash. > temp <- "R & D" > sub("&", "\&", temp) [1] "R & D" > sub("&",
2010 Jun 16
2
Backslash in paste() function
Hi, I'm trying to build a vector of latex commands. However, I need the command strings to begin with a backslash "\". I have: test <- c('foo','bar') and I need to rebuild the array, encapsulating the text items with latex stuff, like this: paste("\parbox[b]{3cm}{", test, "}", fill=TRUE) Actually, cat() prints the string fine if one uses
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]
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 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