Dealing with zip files in R #rstats

> setwd("/home/ajay/Downloads")
> a=dir()
> class(a)
[1] "character"
> grep(".zip",a)
[1]  37  38  41  43  88  96 133
> b=grep(".zip",a)
> a[b]
[1] "alissa-coming-soon-v2-0(1).zip"            
[2] "alissa-coming-soon-v2-0.zip"               
[3] "CAX_EMC_Journalist_Data.zip"               
[4] "CAX_EMC_Racer_Data.zip"                    
[5] "matlab_R2015a_glnxa64.zip"                 
[6] "Photos.zip"                                
[7] "unvbasicvapp__9411003__vmx__en__sp0__1.zip"
> unzip("CAX_EMC_Racer_Data.zip")
> c=dir() 
library(Hmisc)

> c[c %nin% a] 
[1] "CAX_EMC_Racer_Garmin_Camera.csv" 
[2] "CAX_EMC_Racer_Garmin_Watch_Data.csv"
[3] "CAX_EMC_Racer_Motorcycle_Data.csv"
  ps- I know Hadley's convenient wrappR  packages are all the rage now, but nothing, i repeat
 nothing beats Frank Harell and Ripley's cool packages


Author: Ajay Ohri

http://about.me/ajayohri

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s