Skip to content

JBGruber/r-text-analyse-vienna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop Automated Content Analysis

Schedule

Time Day 1 Day 2
09:00-10:30 Obtaining Text Data Word Embeddings
11:00:12:30 Text Scaling and Regression Models Deep Learning
14:00-15:30 Supervised Classification Methods Big Data Projects: Some Tips

More information

See the Syllabus with some info and recommended reading.

Preparation before the course

Prerequisites

I assume that you have R and RStudio installed and have some basic knowledge of R. It makes sense to have a somewhat new version of R. Maybe update it and get your old pacakges back using this little function. If that is not the case, you can also use this workshop to get an overview of available approaches. Or you can try to get up to speed by using the book R for Data Science (Wickham and Grolemund 2023) or a refresher document that I added to the course. If you are coming from Python, you could have a look at Computational Analysis of Communication, which has code for many autmated content analysis task in Python and R side-by-side.

Download the project

I use GitHub to distribute the course material, but you don’t really have to know much about the platform. It’s just where I do most of my work. To download the material, you can use RStudio directly or use another version of git, if you alreay know what you are doing. In RStudio go to “Create a project” (top left corner with this symbol ). Then select “Version Control”:

In the next window, select “Git”:

Then copy the URL https://github.com/JBGruber/r-text-analyse-vienna.git into the URL field and select where to download the project to.

After clicking “Create Project”, a new session should open. That’s it!

Note: when you want to make changes to the documents (e.g., for taking notes in them), you should save them under a new name, so you can update your local files with the changes that I might make in this repository.

Install R packages

The short code below will check the tutorial files for mentioned R packages and install the missing ones on your computer:

if (!requireNamespace("rlang", quietly = TRUE)) install.packages("rlang", dependencies = TRUE)
rlang::check_installed("attachment")
if (!rlang::is_installed("quanteda.corpora")) remotes::install_github("quanteda/quanteda.corpora")
if (!rlang::is_installed("paperboy")) remotes::install_github("JBGruber/paperboy")
if (!rlang::is_installed("mediacloud")) remotes::install_github("joon-e/mediacloud")
remotes::install_github("JBGruber/dataverse-client-r")
rlang::check_installed(attachment::att_from_qmds(list.files(pattern = ".qmd")))

Update packages

You should update the R packages installed on your computer:

update.packages(ask = FALSE, Ncpus = 4L)

This uses 4 cores, you could also use more/less depending on your system.

Python stuff?

In Session 6, we will use some Python to run deep learning transformer models that are not available in R (we will still use R to control Python though). In my experience, it is hard for people to set this up and on computers without dedicated graphics cards it also does not make a lot of sense. So I made the decision to move this part to the cloud. You can still try to follow the explanation in the document before the session, but we will not have time to troubleshoot problems in class.

Wickham, Hadley, and Garrett Grolemund. 2023. Advanced r. https://r4ds.had.co.nz/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages