Skip to content

Commit

Permalink
Update LAB_20-3-B-DataFromQualtricsToR.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MarMall authored Sep 20, 2023
1 parent 0347396 commit d5f1d3e
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions Instructions/Labs/LAB_20-3-B-DataFromQualtricsToR.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ We want to teach you a couple of things in this lab
- processing and exploring the data in a network-specific R-package such as **igraph** -->



## Sub-Lab's Objective

This lab is divided into three sub-sections (for better orientability), and in the separate sub-modules you will:
Expand All @@ -37,20 +36,31 @@ This lab is divided into three sub-sections (for better orientability), and in t

## Exercise 1 - Getting your R/R-Studio environment ready

```r {r setup, include=FALSE}

library(igraph)
library(ggraph)
We will be working with with the tidyverse (especially dplyr) in this DataImport and Data Wrangling Sub-Session. These packages need to be installed / loaded in R first.

relations <- data.frame(from=c("Bob", "Cecil", "Cecil", "David", "David", "Esmeralda"),
to=c("Alice", "Bob", "Alice", "Alice", "Bob", "Alice"),
weight=c(4,5,5,2,1,1))
```r
# if you are pretty sure you did not install any of the below packages to your R / RStudio environment before, then please run the install-commands
# otherwise just go to the next code block

# Load (DIRECTED) graph from data frame
g <- graph.data.frame(relations, directed=TRUE)
install.packages("tidyverse")
install.packages("dplyr")
install.packages("tidyselect")
install.packages("stringr")

```

# Plot graph
plot(g, edge.width=E(g)$weight)




```r
# otherwise load / import the packages you will need for the data import and cleaning / wrangling in this session

library (tidyverse)
library (tidyselect)
library (stringr)
library (dplyr)

```


Expand Down

0 comments on commit d5f1d3e

Please sign in to comment.