Displaying 20 results from an estimated 1085 matches for "backslash".
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 the replacement backslashes, e.g.
gsub("a|b", "\\\\"...
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("\\\\", "\\", "C:\\")
[1] "C:"...
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
..., str)
but this removes the \\ without replacing them by \
Any help much appreciated,
Kay
-----
------------------------
Kay Cichini
Postgraduate student
Institute of Botany
Univ. of Innsbruck
------------------------
--
View this message in context: http://r.789695.n4.nabble.com/replace-double-backslash-with-singel-backslash-tp3989434p3989434.html
Sent from the R help mailing list archive at Nabble.com.
2004 Nov 30
3
Problem with print() and backslashes.
...ve 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( "\!" )
[1] "!"
Now I try it differently...
> print( "\\!" )
[1] "\\!"
The output contains two backslashes. Why?
Regards,
Kevin
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) { cat("\...
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 en...
2007 Apr 27
1
Problem with formatted xtable in R 2.5.0
...ep('@{\\hspace{0.4cm}}', 6), '@{\\hspace{0.1cm}}'))
I do get the following output:
% latex table generated in R 2.5.0 by xtable 1.4-3 package
% Fri Apr 27 13:19:43 2007
\begin{table}[ht]
\begin{center}
\begin{tabular}{rll}
\hline
& big & normal \\
\hline
green & $\backslash$color\{green\}$\backslash$textbf\{big green\} & $\backslash$color\{green\}green \\
red & $\backslash$color\{red\}$\backslash$textbf\{big red\} & $\backslash$color\{red\}red \\
\hline
\end{tabular}
\end{center}
\end{table}
Please, note that the curly braces are prefixed with a bac...
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 to do this in R. Attempting to write a
function to do this runs into
problems:
When I
enter the following:
readyPath
<- function(path){
z <- gsub("\", "/", p...
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 and
many things associated with app_addon_sql_mysql.c fail. I'm pretty sure
this is an asterisk thing and not an addon thing because the query has the
backslashes when...
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 it.
Thanks for any suggestions,
zack
[[alternative HTML version del...
2003 Aug 12
3
grep and gsub on backslash and quotes
...t good).
But The R Language Manual tells me that
Quotes and other special characters within strings
are specified using escape sequences:
\' single quote
\" double quote
so why is the following wrong: gsub("\\\\'", "\\\\"", line)? That or any
other number of backslashes (have tried all up to n=6 just for good
measure).
BTW is it documented anywhere that you need four backslashes in an RE to
match one in the target, when it is being passed as an argument to gsub
or
grep? How would I know how many levels of doubling up to use for any
other
functions? (I got to 4...
2006 Feb 01
3
inserting one backslash
...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
0%-33%") gives "income 0\\%-33\\%", one backslash too much. What is the
appropriate expression to get the desired output (one backslash before
each %-sign)?
I am using R 2.1.0 on suse linux 9.2.
Thanks, Ruud
2012 Dec 17
2
Formatting a path for unix with gsub
..." 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 trained without akapn+tnik.csv"
Various variations on this result in either adding no backslashes, or two at
once. How do I just get one backslash inserted?
Thanks
[[alternative HTML version deleted]]
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] &qu...
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 double backslashes....
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:...
2011 Jul 17
3
gsub() with unicode and escape character
...y.data.2$animals
[1] d?g w?lf cat
Levels: cat d<U+0254>g w<U+0254>lf
I've done the best I can based on what ?gsub and ?enc2utf8 tell me,
but I haven't found a solution.
Unrelated to that problem, but related to gsub() is that I can't find
a way for gsub() to interpret the backslash as a character. In regular
expression, \\ should represent "the character \", but gsub() doesn't:
> data.frame(animals=c("dog","wolf","cat"))->my.data
> gsub("d","\\",my.data$animals)
[1] "og" "wolf" &qu...
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 wait \023 for people \xab
and be patient...