A big part of quantitative and social networks research involves accepting one major thing as fact:
my code sucks, and that’s okay!
It’s not specific to my code–all code sucks, and approaching coding with the assumption that no code is perfect is an important step towards participating in the crowd-sourcing practices that are vital to platforms, like R, that are user-driven. It’s also useful for modeling. Just as no code is perfect, no model is perfect, but you have to practice both coding and modeling to obtain results. This means that your results are, similarly, not perfect. Learning to embrace coding and modeling, including the failed code and models, as informative parts of the research process is useful when interpreting the science. For me, it is one of the ways I check my own biases as a social scientist, a constant reminder that “facts” are not objective or static.
The files available on this page demonstrate my process during the “learning” stage of a research project, when still learning the structure and components of the data. The files do not contain final code executed for the projects, nor do they contain final results.
All code and analysis was executed using RStudio desktop for Mac (Intel, Ventura). Code and output files were composed with Quarto.
Please feel free to borrow and share for your own purposes!

Examples from my own research
Natural Language Processing and Latent Dirichlet Allocation (LDA)
- Quantitative text analysis using text from tweets about masks posted to Twitter during March 2020
Graphs in this example



View the example

Tutorials
R for Social Science Research – The Basics
- Combining and Manipulating Dataframes with “dplyr”
View the Example
Google Trends
- Search trends for disability and chronic illness terms between 2017-2022 using the “GtrendsR” package
Plots in this example
Time Series Plots


Histograms


Inappropriate Plots


View the example
Twitter / Text Data
- Collecting data from Twitter and preparing tweets for analysis with the “twitteR” package and “tidyverse,” an example using a keyword search for terms related to COVID-19.
View the example
- Creating a text corpus, obtaining word frequencies, and basic data visualization for word/count with the “quanteda” and “ggplot2” packages and “tidyverse,” an example using tweets mentioning the keyword “covid”
Plots in this example
Word Clouds



Bar Plots, R Base Graphics

Bar Plots, ggplot2





