Error: unexpected string constant in file path in R

前端 未结 1 1537
有刺的猬
有刺的猬 2021-01-27 22:36

I am trying to run this command in R in order to run a function:

 xlsxToR <- function(\"C:\\\\Users\\\\Nabila\\\\Dropbox\\\\IsolutionsProject\\\\ServiceReques         


        
相关标签:
1条回答
  • 2021-01-27 23:04

    Functions in R

    When you are using function in R you are defining a function (You can use ?function to see the documentation). Inside the parentheses after function you set the arguments of the function. You can also set default values for those arguments using =. After that the body of the function should follow, i.e. an R expression containing the code of the function.

    Your case

    This line of code does not run a function. It defines a function with name xlsxToR. The first thing in the parenthesis is a string, not an argument name, which causes the error. Also your function is just a definition of some argumnents without a body, which probably is not what you are trying to do.

    0 讨论(0)
提交回复
热议问题