Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a touch file on Unix [closed]

Tags:

r

I am new to R programming and had a requirement to create a zero byte/tag/touch file on Unix server using R.

Is it possible to create a file on Unix using R?

like image 383
user3685479 Avatar asked Oct 16 '25 12:10

user3685479


1 Answers

You can create an empty data frame and write that to disk:

x <- data.frame()
write.table(x, file='empty', col.names=FALSE)

Result:

-rw-rw-r--. 1 matt matt    0 May 28 20:29 empty
like image 66
Matthew Lundberg Avatar answered Oct 19 '25 02:10

Matthew Lundberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!