To find the size of a file in R, you can use the file.info()
function to get information about the file, including its size. Then, you can access the size
element of the resulting list. Here's an example:
main.r225 chars12 lines
Alternatively, if you only want to know the file size and don't actually need to read the file into R, you can use the readBin()
function with an empty what
argument to read 0 bytes from the file and return its size. Here's an example:
main.r297 chars13 lines
gistlibby LogSnag