Getting an Error while write CSV

rm(list=ls())
library(dplyr)
library("rpivotTable")
library(tidyr)
library(tidyverse)
library(reshape)
library(reshape2)
input_path="C:\Users\agrawal.rahul\Documents\TBBD Landing\"
setwd(input_path)
date<-"03"
time<-"23"
name <- paste0("http://10.24.9.156//TBBD_NormalHub_Reports//Final_Result_for_LM_Snapshot_2022-Sep-",date,"_",time,".csv")
download.file(name,paste0(input_path,"Landing.csv"))
Landing1 <- read.csv("C:\Users\agrawal.rahul\Documents\TBBD Landing\Landing.csv")
Landing1$Total_landing <- Landing1$ReceivedToday + Landing1$ReceivedToday_RTO
Landing1<-select(Landing1,"HubName","Pincode","Total_landing")
Landing1$HubName<-toupper(Landing1$HubName)
sum(Landing1$Total_landing)
TBBD_Mapping1 <- read.csv("C:\Users\agrawal.rahul\Documents\TBBD Landing\TBBD Mapping.csv")
#TBBD_Mapping1 <- select(TBBD_Mapping1,"Pincode","HubName")
TBBD_Mapping1$HubName<-toupper(TBBD_Mapping1$HubName)

#Landing1$DH_1 <- TBBD_Mapping1$HubName[match(Landing1$Pincode,TBBD_Mapping1$Pincode)]
Landing2<- merge(Landing1,TBBD_Mapping1,by.x = "Pincode",by.y = "Pincode",all.x = T)
write.csv(Landing2,paste0(date,"_",time,"Final_landing.csv"))

####ERROR######
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file '03_23Final_landing.csv': Permission denied

This signifies that the system user id under which the program is running (which may or may not be the system id of the user) does not have write permissions at the destination, http://10.24.9.156//. Setting permissions correctly on a Win file system is something I can't help with.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.