I'm currently learning Sentiment Analysis in r ,
i got stuck in part how to properly read and import the data into my case,
i want to know how to read data using scan() in r ,
but how to make that it gonna read the white space too between string in one row from the txt
case :
for example,
positive.txt contain :
Not Strong
*the string above written inside txt file without separated semi colon or comma, just line spacing \n
so, i read that txt formatted file by using this in r :
positive -> scan('positive.txt', what = ' ', sep="\n")
there's no error,
but after i check,
the main problem is read the imported file by using scan() will read the white space between character,
so from input positive.txt file:
1) Not Strong
the result using scan() into positive.txt file in r will end up like this :
1) Not
2) Strong
What i expected is :
how to make scan() file in r keep maintain the white space from character inside positive.txt :
1) Not Strong
the result i expected is still :
1) Not Strong
*note, the number 1 is only some guide like some kind index, to help understand this problems.
readLinesinstead - rawr