Generalize to command line
Generalize to command line

HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015
source('topics.r')

for( path in commandArgs(trailingOnly=TRUE) ) {

   print( paste( "Working on" , path ) )

   unlink( paste( path , '*.rdata*', sep = '' ) ) ## remove all existing rdata in the folder

   dtm <- create_dtm( path )
   save( dtm , file = paste( path, 'dtm.rdata' , sep = '' ) )

}

source('~/digivaalit_public/topics/topics.r')

paths <- c( 'citizen-tweets-lemma' , 'digivaalit-media-lemmas', 'candidate-tweets-lemma' )

for( path in paths ) {

   path = paste( '/homeappl/home/mnelimar/' , path, '/',  sep = '' )

   print( paste( "Working on" , path ) )

   unlink( paste( path , '*.rdata*', sep = '' ) )
   dtm <- create_dtm( path )
   save( dtm , file = paste( path, 'dtm.rdata' , sep = '' ) )

}
