Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (5.3k points)

I'm writing an R package where the R code talks to a Java application. The Java application outputs a CSV formatted string and I want the R code to be able to directly read the string and convert it into a data.frame.

1 Answer

0 votes
by

To read from a string using read.csv, you can use the text argument of read.csv.

For example:

data <- read.csv(text="col1,col2

0.2,4.2

7.71,34.84")

Output:

data

  col1  col2

1 0.20  4.20

2 7.71 34.84

Browse Categories

...