Community of practice


Why R?

Did you know that with R, you can clean and process your research data, conduct a wide range of statistical analyses, create publication-quality figures, and save scripts that allow you to reproduce your work with the push of a button – all using just one program!

Artwork by @allison_horst

R is a programming language that is popular in both academia and industry for its broad functionality and approachable learning curve. R and supporting tools are open-source and totally free, making it easy to find resources developed by a global community of users. No matter which discipline you work in, you’re likely to find packages and tutorials targeted toward the types of analyses you want to run, and resources that make it easy to get started or “unstuck”. You can also develop your own packages for specific purposes in your research and publish them for others to use.

Do you want to build your skills in the programming language R, write R code with others, or ask questions about working with R? Check out some examples of the many cool things you can build with R!

Fun with R

During R Café meetings, we’re trying out different tools and types of analysis. Here’s a small sample of what we’ve been working on:

Code
# Load library wordcloud2
library(wordcloud2)

#Load data
wcloud_data <- readRDS(here('data', 'wcloud_data.RDS'))

# Define colors 
tud_blue<-'#00A6D6'
mycolors <- c( rep(tud_blue,6),rep('#000000',1000))

# Create a word cloud
set.seed(12345)
wordcloud2(wcloud_data, size = 0.7, color = mycolors)

Words used in IDE master theses: word cloud created with wordcloud2 package

Code
# Load networkD3 package
library(networkD3)
library(igraph)

# Load data 
network <- readRDS(here('data', 'network.RDS'))

# Create networkD3 object.
network_D3 <- igraph_to_networkD3(g = network)

# Define node size.
network_D3$nodes$size <- 100* V(network)$degree

# Degine color group (I will explore this feature later).
network_D3$nodes$group <- 1

# Define edges width. 
network_D3$links$value <- 20*E(network)$width

# Define colours
ColourScale <- 'd3.scaleOrdinal()
            .domain(["lions", "tigers"])
           .range(["#00A6D6", "#694489"]);'

# Plot
forceNetwork(
  Links = network_D3$links, 
  Nodes = network_D3$nodes, 
  Source = 'source', 
  Target = 'target',
  NodeID = 'name',
  Group = 'group', 
  opacity = 0.9,
  Value = 'value',
  Nodesize = 'size', 
  # We input a JavaScript function.
  fontSize = 7,
  zoom = TRUE, 
  opacityNoHover = 1,
  fontFamily = "sans-serif",
  linkColour = "black",
  colourScale = JS(ColourScale)
)

Connections between words in IDE master theses: bigram count network created with networkD3 package

Code
# Load library wordcloud2
library(dygraphs)
library(quantmod) # API to get stock data

#Load data of TESLA stock
TSLA <- getSymbols("TSLA", env=NULL)

#Load data of AMZN stock
AMZN <- getSymbols("AMZN", env=NULL)
# create new df with Amazon and Tesla data
stocks <- cbind(AMZN[,2:4], TSLA[,2:4])


# Define colors 
tud_cols<- c('#00A6D6', '#EC6842', '#0C2340', '#FFB81C' )
tud_cols2<- c('#00A6D6', '#00B8C8', '#0C2340', '#0076C2' )


# Create a dygraph
dygraph(stocks) %>%
  dySeries(c("AMZN.Low", "AMZN.Close",
             "AMZN.High"), label = "AMZN") %>%
  dySeries(c("TSLA.Low", "TSLA.Close",
             "TSLA.High"), label = "TSLA") %>% 
  dyRangeSelector() %>%
  dyOptions(colors = tud_cols2[c(1,3)]) %>%
  dyAxis("x", drawGrid = FALSE) 

Amazon and Tesla Share Prices with dygraphs package

Join the TU Delft R Café!

Live coding during our monthly R Café meeting in September 2022

R Café reproducible research & pizza meeting in February 2023

We’re a group of R enthusiasts from across the TU Delft community who meet monthly to discuss questions from the very broad Why should I use R? to the hyper-specific Why is my code not working?!

Together we make up a supportive community of practice for researchers to share knowledge and learn with each other in an open and informal setting.

If you plan to join online, please pre-register so that we can order enough refreshments. See below for upcoming dates and registration links, and make sure to update your registration if you can’t make it.

Our initiative was inspired by Utrecht University’s R Café now Programming Café.

Who can join?

The R Café is open to anyone who works in R or is interested in learning. No prior experience with R is necessary - all are welcome!

Artwork by @allison_horst

Many of our members have recently completed the Data Carpentry workshop and are looking for a space to continue practicing R skills with others. You can also join if you’ve got plenty of R experience and want to share some awesome tips and tricks (e.g., about an R package, type of analysis, or visualization) with others!

To get the most out of the R Café, we suggest that you bring your laptop with R and RStudio installed. You can find details on installing R and RStudio in the Resources section below - please let us know if you need any help.

How do R Café meetings run?

Our monthly meetings usually have a theme which we can touch upon by brief presentations by one or more of our members, exercises for us to work through, a group discussion, or some combination.

We take a hands-on approach to work through problems and always have RStudio open for live coding.

If you have an R-related question or challenge that is specific to your project, we are happy to discuss in any of our meetings. If your question requires a lot of context, it’s helpful if you can send us an email with details before the meeting.

Because we know our audience, we offer a unique combination of ☕ and 🍕.

Want to get involved?

Got a favorite topic you’d like us to explore, or an idea for a presentation at an upcoming R Café? Please let us know at: rcafe-lib@tudelft.nl

Resources

Some inspiration for working with R!

Artwork by @allison_horst

For a full list of R resources collected by members of the R Café, click here.

Contact

The R Café initiative emerged in the TU Delft Library Research Data Services Team and the Digital Competence Centre.

Artwork by @allison_horst

The organizers are Aleksandra Wilczynska, Bjørn Bartholdy and Roel Janssen. For questions or more information, please contact rcafe-lib@tudelft.nl.

You can also find us on GitHub.

Subscribe

To stay informed about upcoming events, please subscribe to our mailing list.

Upcoming meetings

TBD

Past meetings

R Café May 2024: Using APIs to retrieve social media data
  • Date: Thursday, 23rd May 2024
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Blue Room
  • Presenter: Sofia Gil-Clavel
  • Resources: GitHub repo
R Café April 2024: R vs Python
  • Date: Thursday, 25th April 2024
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Blue Room
  • Presenter: Roel Janssen
R Café March 2024: Open forum - come and have a chat!
  • Date: Friday, 22nd March 2024
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Albert Einstein
  • Presenter: NA
R Café February 2024: Creating an R Package (the sequel)
  • Date: Friday, 23rd February 2024
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Orange Room
  • Presenter: TBD
  • Resources: presentation; repo
R Café January 2024: Creating an R package
R Café December 2023: Advent of Code
  • Date: Friday, 15th December 2023
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Orange Room
  • Presenter: Bjørn Bartholdy
Code performance in R
  • Date: Friday, 17th November 2023
  • Time: 12PM – 13:30PM CEST
  • Place: TU Delft Library, Orange Room
  • Presenter: Roel Janssen
Plot-a-thon showcase event
  • Date: 11th October 2023
  • Time: 15PM – 17PM CEST
  • Place: TU Delft Library, Orange Room
  • Presenter: Roel Janssen
Use APIs to source your data in R
Troubleshooting walk-in session
  • Date: 7 July 2022
  • Time: 3:00PM – 4:30PM CEST
  • Place: TU Delft BK Building, BG.West.350
A gentle introduction to building web apps with R Shiny
Level up your reproducibility game with Quarto
Network science approach to psychopathology using R
Organizing a research paper as an R package
  • Date: 10th February 2023
  • Time: 11AM – 12:30PM CEST
  • Place: TU Delft Library, Albert Einstein room Blue Room Orange Room
  • Presenter: Bjørn Bartholdy
  • Resources: Walk-through
Dealing with messy data in R
  • Date: 13th January 2023
  • Time: 11AM – 12:30PM CEST
  • Place: TU Delft BK Building, BG.West.640
  • Presenter: Rodrigo Revilla
  • Resources: Workbook
R for Geospatial Data
  • Date: 2nd December 2022
  • Time: 11AM – 12:30PM CEST
  • Place: TU Delft Library, Albert Einstein room
  • Resources: Exercises
Time series visualisation with dygraphs library
  • Date: 4th November 2022
  • Time: 11AM – 12:30PM CEST
  • Place: TU Delft BK Building, BG.West.670
  • Resources: Exercises
Using the apply family of functions
  • Date: 26 September 2022
  • Time: 11AM – 12:30PM CEST
  • Place: TU Delft Library, Steve Jobs room
  • Resources: Exercises
Prepare your script without data
  • Date: 26 August 2022
  • Time: 11AM – 12:30PM
  • Place: TU Delft Library, Steve Jobs room
  • Resources: Slides
Do you have questions about working with R, or want to write R code with others?
  • Date: 7 July 2022
  • Time: 11:00AM – 12:00PM
  • Place: TU Delft Library, Gertrude Stein room
Do you have questions about working with R, or want to write R code with others?
  • Date: 9 June 2022
  • Time: 11AM - 12PM
  • Place: TU Delft BK Building, BG.West.350
Do you have questions about working with R, or want to write R code with others?
  • Date: 11 May 2022
  • Time: 10AM-11AM
  • Place: TU Delft Library, Steve Jobs room
Do you have questions about working with R, or want to write R code with others?
  • Date: 4 April 2022
  • Time: 11:30AM – 12:15PM
  • Place: Online
Do you have questions about working with R, or want to write R code with others?
  • Date: 3 March 2022
  • Time: 10:00AM – 10:45AM
  • Place: Online
Do you have questions about working with R, or want to write R code with others?
  • Date: 7 February 2022
  • Time: 11:00AM – 11:45AM
  • Place: Online
Do you have questions about working with R, or want to write R code with others?
  • Date: 29 November 2021
  • Time: 10AM-11AM
  • Place: Online
R Café Kickoff
  • Date: 1 November 2021
  • Time: 10AM-11AM
  • Place: TU Delft Library CoffeeStar