Extracting files from a tar archive is done with untar
function from the utils
package (which is included in base R).
untar(tarfile = "bar.tar", exdir = "./foo")
This will extract all files in "bar.tar"
to the "foo"
directory, which will be created if necessary. Tilde expansion is done automatically from your working directory. Alternatively, you can pass the whole path name to the tarfile.