🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

R script: backslash \ in file_path macro cannot be parsed

User: "Fred12"
New Altair Community Member
Updated by Jocelyn

hi,

In rapidminer, the file_path macro is used with single backslashes , not double "\\"" or "/" like usual in R.

Therefore, the path cannot be read by the R script.

I tried to do some conversion like

<SPAN class="pln">normalizePath</SPAN><SPAN class="pun">(</SPAN><SPAN class="pln">example.csv</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> winslash </SPAN><SPAN class="pun">=</SPAN> <SPAN class="str">"/"</SPAN><SPAN class="pun">)</SPAN>

 

<SPAN class="pln">gsub</SPAN><SPAN class="pun">(</SPAN><SPAN class="str">"\\"</SPAN><SPAN class="pun">,</SPAN> <SPAN class="str">"/"</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> example.csv</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> fixed </SPAN><SPAN class="pun">=</SPAN> <SPAN class="lit">TRUE</SPAN><SPAN class="pun">)</SPAN>

but nothing worked...I would like to use file_path macro to create an excel file in the same directory..

 

Dec 16, 2016 11:09:47 PM INFO: [1] "Failed to parse the script."
Dec 16, 2016 11:09:47 PM INFO: [1] "'\\U' ohne Hex-Ziffern in der Zeichenkette beginnend mit \"\"C:\\U\" genutzt"
 

Find more posts tagged with

Comments

No comments on this post.