What are the different ways of writing into file from R?

0 votes
What are the different ways of writing into file from R?
Aug 29 in Data Analytics by payal
45 views

1 answer to this question.

0 votes

Hi Payal,

These are the ways to write text files from R.

var - R Variable.

1. Comma delimited text file - use write_csv(var,"path/filename.csv")

write_csv(m,"path/file.csv")

2. CSV to Excel file - use write_excel_csv(var,"path/filename.csv")

write_excel_csv(p,"path/file.csv")

3. Text files with tab - use write_fwf(var,"path/filename.fwf") or write_tsv()

write_fwf(k,"path/file.fwf")
write_tsv(k,"path/file.tsv")

4. line to file -  use write_lines(var,"path/filename.csv")

write_lines(c,"path/file.csv")

5. Full text file - use write_file(var,"path/filename.csv")

write_file(b,"path/file.txt")

6. Any delimited file -  use write_delim(var,"path/filename.csv")

write_delim(a,"path/file.txt")

hope it helps!

answered Aug 29 by anonymous
• 31,840 points

Related Questions In Data Analytics

0 votes
1 answer

What are the different ways to manage NA's in data?

A few functions to manage NA are ...READ MORE

answered Oct 16 in Data Analytics by Cherukuri
• 31,840 points
35 views
0 votes
1 answer

What are the options for deploying models in production with R?

Well, I could say that the answer ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,130 points
299 views
0 votes
1 answer
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

answered Apr 26, 2018 in Data Analytics by DeepCoder786
• 1,720 points
222 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
114 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
158 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points
85 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
99 views
0 votes
2 answers

what are the different ways of getting/reading data into for cleaning

Most used functions for reading or extracting ...READ MORE

answered Aug 22 in Data Analytics by anonymous
• 31,840 points
31 views
0 votes
1 answer

What are the different types of input for parameters in rmarkdown?

There are different types of inputs that ...READ MORE

answered Jul 30 in Data Analytics by Cherukuri
• 31,840 points
27 views