I have 153 zipped Landsat 8 (with *.tar.gz extension) datasets in one folder. I need to extract them into specific folders named zip files.
aa = 'D:/Landsat/154032/Landsat8'
mypath = setwd(aa)
#list of files in the directory
fromdir = list.files(path = aa, pattern = '*.tar.gz', full.names = F)
#set the directory to save files in working directory
todir = file.path(mypath)
#extract zipped folders
ldply(.data = fromdir, fun = unzip, exdir = todir)
Problem is last code doesn't work because of it doesn't create folders with zip files names