Tuesday, November 11, 2014

Session 4 Classwork files on LMS

Hi all,

Sorry about the delay in updating the blog and the LMS.

Pls find on LMS R code, data and instructions for sessions 4 (text analysis).

That for session 5 (network analysis) will come in the next couple of days.

As CBA students, my expectation is that you will:

(i) diligently follow the instructions given,

(ii) read and understand the R code line-by-line before running it,

(iii) run the code and replicate the classwork examples,

(iv) discuss any issues etc that arise here on this blog by using the comments section,

(v) solve the group homeworks by tweaking and customizing the R code as required, and

(vi) provide constructive feedback where possible.

Instructions:

1. Unzip contents of the zip folder

2. Open Rstudio. File menu --> Open File --> textanalysis R code.R

3. the textanalysis R code.R file will open as an additional window (on the top left) in Rstudio)

4. To run any lines, select them and click the Run icon on the top right of the window. Ensure internet is connected.

5. Read the lines before running as some require input from your side (which files to read in etc)

6. The zip folder contents are self-contained and hopefully should run smoothly. However, if you encounter issues, pls let us know.

7. Pls email aashish_pandey@isb.edu with a copy to Atryee in case of any R related issues. Your group homework for this session will be up soon, in a few days. Pls ensure you are comfortable with this code before the homework arrives.

Thanks.

Sudhir

6 comments:

  1. Experiencing the following error while installing "qdap" package. Any hint to resolve this will help.

    Thanks,
    Chandra
    -------------------------------------------
    > install.packages("qdap")
    Installing package into ‘C:/Users/aluruc/Documents/R/win-library/3.1’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘XML’

    trying URL 'http://cran.skazkaforyou.com/bin/windows/contrib/3.1/XML_3.98-1.1.zip'
    Content type 'application/zip' length 4289164 bytes (4.1 Mb)
    opened URL
    downloaded 4.1 Mb

    Warning in install.packages :
    downloaded length 4256396 != reported length 4289164
    trying URL 'http://cran.skazkaforyou.com/bin/windows/contrib/3.1/qdap_2.2.0.zip'
    Content type 'application/zip' length 2825738 bytes (2.7 Mb)
    opened URL
    downloaded 2.7 Mb

    Warning in install.packages :
    error 1 in extracting from zip file
    Warning in install.packages :
    cannot open compressed file 'XML/DESCRIPTION', probable reason 'No such file or directory'
    Error in install.packages : cannot open the connection

    ReplyDelete
    Replies
    1. You need to have the latest version of java installed. Google for java download and install before running the R code.

      Sudhir

      Delete
  2. Hi Chandra,

    Pls email aashish_pandey@isb.edu and he will take a look at it. BTW, did you google for the error first? Sometimes that works.

    Sudhir

    ReplyDelete
  3. Hello Sudhir - I'm trying to use the R code provided to extract data -amazon reviews extraction code.R

    Would you be able to provide instructions on how to execute this code and extract data. I'm also using google to find this out. Any inputs would help me save time :).. Thank you

    -Hari

    ReplyDelete
    Replies
    1. Hi Hari,

      The code is designed to be executed directly off Rstudio. Some inputs from you will be needed, like the URL of the reviews page of your chosen product from amazon India, and so on. Look at the documentation provided in # comments around the code.

      Sudhir

      Delete
  4. Thank you Sudhir. I was able to successfully execute the code and also analyze it now through Rstudio.

    ReplyDelete