<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: R Project: How do I use commands involving paths with R language in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206738#M187735</link>
    <description>&lt;P&gt;Thanks for posting the error, but can you post the command string that generated the error?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2015 21:45:15 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-09-08T21:45:15Z</dc:date>
    <item>
      <title>R Project: How do I use commands involving paths with R language in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206737#M187734</link>
      <description>&lt;P&gt;I want to use R to train a machine learning model, export it using saveRDS(), and then importing it again within Splunk using readRDS(). &lt;BR /&gt;
The problem is, I keep getting errors when trying to specify the path. This happens for any command involving paths; setwd, write.csv, etc.&lt;/P&gt;

&lt;P&gt;Errors are similar:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;command="r", R exited with code 1: Error: unexpected '/' in: " setwd(/" Execution halted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It probably has to do something with escaping the slashes, but any combination/amount of backslashes results in the same error..&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 08:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206737#M187734</guid>
      <dc:creator>dkoops</dc:creator>
      <dc:date>2015-09-08T08:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: R Project: How do I use commands involving paths with R language in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206738#M187735</link>
      <description>&lt;P&gt;Thanks for posting the error, but can you post the command string that generated the error?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 21:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206738#M187735</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-09-08T21:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: R Project: How do I use commands involving paths with R language in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206739#M187736</link>
      <description>&lt;P&gt;Thanks for taking the time to look into my question, but it seems I figured it out. I was trying to do the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| r "
net = readRDS("C:\\User\\Documents\\R\\object.rds")
"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It went wrong with the double quotes within the double quotes; replacing all double quotes used in the R language with single quotes did (part of) the trick. (I should have been able to figure that out quicker, shame on me..)&lt;/P&gt;

&lt;P&gt;It resulted in the following error however:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;command="r", R exited with code 1: Error: '\U' used without hex digits in character string starting "'C:\U" Execution halted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems you also have to escape backslashes thrice for it to work (i'm guessing once for Splunk once for R?) Thus the working code being:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| r "
net = readRDS('C:\\\User\\\Documents\\\R\\\object.rds')
"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Sep 2015 07:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/R-Project-How-do-I-use-commands-involving-paths-with-R-language/m-p/206739#M187736</guid>
      <dc:creator>dkoops</dc:creator>
      <dc:date>2015-09-09T07:55:16Z</dc:date>
    </item>
  </channel>
</rss>

