Displaying 20 results from an estimated 7000 matches similar to: "Backslash in paste() function"
2005 Aug 30
1
Convert ftable to latex?
Dear list,
I cannot make the latex command to output a ftable objet the way I
want it. Is it posible?
I found a post in the archives saying that one should use the rgroup
and n.rgroup arguments to supply the row names, but so far I have been
unsuccessful.
This is what I have:
>
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
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("\\\\",
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
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("&",
2006 Oct 28
1
(kein Betreff)
Frank Harrell rote in a message dating from Oct 8th:
> n.group is an argument to latex.default in the Hmisc package
I must admit that I can't find it in the function head,
which reads on my installation:
function (object, title = first.word(deparse(substitute(object))),
file = paste(title, ".tex", sep = ""), append = FALSE, label = title,
rowlabel = title,
2006 Jan 04
1
AMP: Losing backslash characters in config files
I've just started using AMP and found that I have a problem with escaped characters in config files.
In particular, I have a custom config item that needs a semicolon in...
SetVar(_ALERT_INFO=info=auto-answer;delay=1)
To get the part of the line after the ; to be accepted by Asterisk as a non-comment it needs to be escaped with a backslash, but I have found that I need to put two
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
\"
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
2007 Aug 07
2
backslash c
How do I get output with "\color{blue}", i.e. with
only one backslash???
> "\color{blue}"
[1] "color{blue}"
Warning messages:
1: '\c' is an unrecognized escape in a character
string
2: unrecognized escape removed from "\color{blue}"
> "\\color{blue}"
[1] "\\color{blue}"
>
Any help greatly appreciated.
Best regards,
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]
2008 Jan 09
1
Help with backslash issue on smbfs
I am in the middle of migrating a number of applications from one server
to another and I am running into an issue with backslashes on a smbfs
mount. Basically, the backslash can be used in a file path on the old
server and not on the new. This turns out to be important because of the
samba share is used to store data for a large number of FTP clients, who
use an old automated script which chokes
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
------------------------
2010 Jun 30
1
backslash escape characters in JSON strings
Hi,
I am trying to consume a web service that returns a JSON string, however,
when I run
> fromJSON(s)
Error: '\/' is an unrecognized escape in character string starting "http:\/"
because the string s contains a single backslash, which is the JSON escape
character, but R expects 2 backslashes, I think.
Is there anyway to preprocess the JSON string returned from the web
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
2006 May 17
1
changing single to double backslash
Hi, all. I didn't find something like this in the faq
list:
I wound like build a function to substitute single
backslashes in a string to double:
ChangeSlash<-function(dir) ...
so
ChangeSlash("C:\mydocs\test")
returns
"C:\\mydocs\\test"
Thanks,
C.
_______________________________________________________
Abra sua conta no Yahoo! Mail: 1GB de espa?o, alertas
2005 May 23
1
Backslash
Why sometimes one has to put a double
backslash in regular expressions, but
often simple backslashes work too?
Is only a \ required for giving a
metacharacter its usual meaning?
---------------------------------------
u=grep('\\{[\\-u]x',a,perl=T)
# equivalent to
u=grep('\{[\-u]x',a,perl=T)
# but
u=grep('\w',a,perl=T)
# is not correct and requires
1999 Mar 20
1
How to get '\h' through print() or paste()?
Hello,
[really hoping not to ask something the 1001th time]
I need single backslashes printed for generating TeX-code.
That works:
> print("\begin{tabular}")
[1] "\begin{tabular}"
But \h seems to be interprated in some way:
> print('\hline')
[1] "hline"
Hm, trying to mask the backslash:
> print('\\hline')
[1]
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"
2008 Jul 14
2
Backslash in sub pattern?
Dear guRus,
I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the
backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".
sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"