Warning in file(file, ifelse(append, "a", "w")) - error in RSTUDIO

217 views Asked by At

I am trying to write a dataframe to csv file, where I am getting the below error:

Warning in file (file, ifelse(append, "a", "w")): cannot open file '_______________.csv': Permission denied.
Warning: Error in file: cannot open the connection

Here is the script:

    input_fileName = file.path(s_input, paste0("input_1", now_1, ".csv"))
    
    dataframe_1=data.frame(g=unlist(strsplit(gsub(", +", ",", gsub("\\s+", ",", input$gid)), ',')),     start_date = input$start_d, end_date = input$end_d, 0, 0, 0, 0)
    
    write.table(
      x = dataframe_1,
      file = input_fileName,
      row.names = FALSE,


      col.names = FALSE,
      quote = FALSE,
      sep = ','
    )

The error is raised at write.table(). I tried reading the file, but the same error has raised there. How to resolve this?

0

There are 0 answers