I have a text file (say Dimension.txt) with certain data in it,
I want to write a function in R that would convert this text file into a pdf file.
I googled a lot before I ended up here. There are a lot of places where people have asked as to how to convert a pdf file to text not the vice-versa.
Here is my code:
FunctionFun <- function(.csv)
{
sink('Dimension.txt')
csv <- read.csv(.csv)
dimValue <- dim(csv)
print("The dimension of the dataset is:")
print(dimValue)
return(dimValue)
sink('Dimension.txt', append=TRUE)
}
When I run FunctionFun("tips.csv")
, I get a text file as an output, which looks like:
Now, my task is to write a separate function that would convert Dimension.txt to Dimension.pdf.
Your help is appreciated.
Thanks.