Skip to content

Commit 774d64c

Browse files
adding subsections
1 parent b435b53 commit 774d64c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

posts/2025-07-06-CSEE-intro-shiny/index.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class(data)
5151

5252
As you can see, the data are stored in a **list** object.
5353

54+
## Lists
55+
5456
In R lists act as containers. Unlike atomic vectors, the contents of a list are not restricted to a single mode and can encompass any mixture of data types. Lists are sometimes called generic vectors, because the elements of a list can by of any type of R object, even lists containing further lists. This property makes them fundamentally different from atomic vectors.
5557

5658
A list is a special type of vector. Each element can be a different type.
@@ -190,6 +192,8 @@ library(package)
190192
191193
```
192194

195+
## Writing functions
196+
193197
If we only had one university's network to plot, we could stop here... but we have 24 others to plot. Let's wrap our code in a **function** so that we can repeat several operations with a single command.
194198

195199
You can write your own functions in order to make repetitive operations using a single command. Let’s start by defining our function ```plot_network``` and the input parameter(s) that the user will feed to the function. Afterwards you will define the operation that you desire to program in the body of the function within curly braces ```{ }```. Finally, you need to assign the result (or output) of your function in the ```return()``` statement.

0 commit comments

Comments
 (0)