Knitr Wont Compile PDF: "Error in Tools::File_Path_As_Absolute(Output_File)"

Output .pdf does not exist - error when i knit my rmd file to pdf

I realised my error was that I had not installed a tex software. I accomplished this by running the install.package(tinytex) command and the install_tinytex() function to have the tex software for use with r-markdown installed

R rgdal::readOGR issue with file path refering to linux home directory

you can either use tools::file_path_as_absolute() like this:

library(tools)
readOGR(file_path_as_absolute('~/documents/zipcodes'), 'zipcodes')

or

path.expand() as hrbrmstr mentioned in his comment:

readOGR(path.expand('~/documents/zipcodes'), 'zipcodes')

Another, more inconvenient way would be to use base::dirname() in combination with paste0():

readOGR(paste0(dirname('~/documents/zipcodes'), 'zipcodes'), 'zipcodes')


Related Topics



Leave a reply



Submit