Re: [R] Replacing backslashes with slashes

From: yvonnick noel <>
Date: Thu 05 Jan 2006 - 04:54:08 EST

> You really don't understand what I wrote (and it is in many places in > the R documentation). How are you getting that string into R?

OK. A practical example is probably necessary here. I have rewritten a small Rpad page to show you what I mean. It is copied at the end of this post.

Just save it under your current R directory, under the name, say, "example.Rpad", and then:


Your browser will open and display the page (I tried it with Mozilla Firefox). Then browse your disk using the browse button and select any file. Then click the "Print the name" button.

The full file name is sent to R and internally stored in the R variable "datafile". The embedded R code is just :


This is the way I get this string.


Here is the script :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html>

    <title>An example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
    <script type="text/javascript" src="editor/Rpad_loader.js">

<H1>Load data</H1>
<h3><a name="fil"> From a local or remote file </a></h3>
<span contenteditable="false">

    <p><input type="file" name="datafile" size="40" class="Rpad_input" id="datafile" rpad_type="Rstring"></p>

    <P><input type="button" onclick="javascript:top.Rpad_calculate();" value="Print the name"></p>
<span class="wrapperForHidden" contenteditable="false">
    <div class="Rpad_input" rpad_type="R" style="DISPLAY: none">

        # This is the R code


</html> mailing list PLEASE do read the posting guide! Received on Thu Jan 05 06:59:07 2006

This archive was generated by hypermail 2.1.8 : Thu 05 Jan 2006 - 11:00:59 EST