How to create a blank csv file in R?


We can create a blank csv file using a single line code in R and the function that can do this is cat. If we want to have the file blank then NULL value will be passed inside the function and the file name must be used. For example, if we want to create a blank file named as BlankCSV then it can be created by using the below code:

> cat(NULL,file="BlankCSV.csv")

Output:

This is the output from documents folder of the system where all the R files are stored by default(we can change that location if we want to):

The output of the file will be like this:

Output

Updated on: 19-Nov-2020

386 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements