[ 
https://issues.apache.org/jira/browse/ARROW-17208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17571782#comment-17571782
 ] 

Wytze Gelderloos commented on ARROW-17208:
------------------------------------------

Here is the session information:
```

R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252    
LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C                      
[5] LC_TIME=Dutch_Netherlands.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] magrittr_2.0.3   tidyselect_1.1.2 bit_4.0.4        R6_2.5.1         
rlang_1.0.2      fansi_1.0.3      dplyr_1.0.8      tools_4.1.3     
 [9] arrow_7.0.0      utf8_1.2.2       cli_3.2.0        DBI_1.1.2        
dbplyr_2.1.1     ellipsis_0.3.2   bit64_4.0.5      assertthat_0.2.1
[17] tibble_3.1.6     lifecycle_1.0.1  crayon_1.5.1     purrr_0.3.4      
duckdb_0.3.2-2   vctrs_0.4.1      glue_1.6.2       compiler_4.1.3  
[25] pillar_1.7.0     generics_0.1.2   pkgconfig_2.0.3 
```

Running gc as mentioned in [ARROW-16421] [R] Permission error on Windows when 
deleting file in dataset - ASF JIRA (apache.org) indeed solved this. Should've 
looked further....

Thanks a lot for maintaining this awesome package! :)

> Removing files after reading them in R
> --------------------------------------
>
>                 Key: ARROW-17208
>                 URL: https://issues.apache.org/jira/browse/ARROW-17208
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>    Affects Versions: 7.0.1
>            Reporter: Wytze Gelderloos
>            Priority: Minor
>
> In R it's not possible to delete the files eventhough the dataframe is 
> cleared from the R environment. 
>  
> write.csv(mtcars, file = "mtcars.csv", quote = FALSE, row.names = FALSE)
> df <- arrow::to_duckdb(arrow::open_dataset("mtcars.csv", format = "csv", 
> delimiter = ","))
> df <- df %>% select(c("mpg", "disp", "drat", "wt")) %>% collect()
> ## Do some checks on df.
> rm(df)
> file.remove("mtcars.csv")
> The `file.remove` leads to a Permission Denied error eventhough the dataframe 
> is cleared from the R environment. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to