Rows: 255 Columns: 5
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): From, To, Type, Notes, Generation
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Code
head(got_marriages)
# A tibble: 6 × 5
From To Type Notes Generation
<chr> <chr> <chr> <chr> <chr>
1 Targaryen Stark Married R+L=J Current
2 Baratheon Martell Engaged died Current
3 Baratheon Stark Engaged broken Current
4 Martell Essos Married <NA> Current
5 Martell Reach Affair <NA> Current
6 Martell Essos Affair <NA> Current
The network has 20 vertices and 255 edges. It is a unimodal, undirected and unweighted network.
Code
vcount(got_marriages_net)
[1] 20
Code
ecount(got_marriages_net)
[1] 255
Code
is_bipartite(got_marriages_net)
[1] FALSE
Code
is_directed(got_marriages_net)
[1] FALSE
Code
is_weighted(got_marriages_net)
[1] FALSE
Code
vertex_attr_names(got_marriages_net)
[1] "name"
Code
edge_attr_names(got_marriages_net)
[1] "Type" "Notes" "Generation"
Plotting the network
Code
plot(got_marriages_net)
##Trying a Second dataset The fish encounters network has 30 vertices and 114 edges. It is also a unimodal, undirected and unweighted network. I am not sure how to interpret the plot for the fish encounters data.
Code
fish<-fish_encountershead(fish)
# A tibble: 6 × 3
fish station seen
<fct> <fct> <int>
1 4842 Release 1
2 4842 I80_1 1
3 4842 Lisbon 1
4 4842 Rstr 1
5 4842 Base_TD 1
6 4842 BCE 1
---title: "Challenge 1 Mekhala"author: "Mekhala Kumar"desription: "Used gotmarriages and fish_encounters datasets"date: "02/22/2023"format: html: toc: true code-fold: true code-copy: true code-tools: truecategories: - challenge1 - Mekhala Kumar - gotmarriages - fish_encounters---```{r}#| label: setup#| include: false#| library(tidyverse)library(googlesheets4)library(igraph)library(statnet)```## Reading in the data```{r}got_marriages<-read_csv("_data/got/got_marriages.csv")head(got_marriages)```## Creating the network```{r}got_marriages_net<-graph_from_data_frame(got_marriages,directed=FALSE)```## Features of the networkThe network has 20 vertices and 255 edges. It is a unimodal, undirected and unweighted network.```{r}vcount(got_marriages_net)ecount(got_marriages_net)is_bipartite(got_marriages_net)is_directed(got_marriages_net)is_weighted(got_marriages_net)vertex_attr_names(got_marriages_net)edge_attr_names(got_marriages_net)```## Plotting the network```{r}plot(got_marriages_net)```##Trying a Second datasetThe fish encounters network has 30 vertices and 114 edges. It is also a unimodal, undirected and unweighted network. I am not sure how to interpret the plot for the fish encounters data.```{r}fish<-fish_encountershead(fish)fish_n<-graph_from_data_frame(fish_encounters,directed=FALSE)vcount(fish_n)ecount(fish_n)is_bipartite(fish_n)is_directed(fish_n)is_weighted(fish_n)vertex_attr_names(fish_n)edge_attr_names(fish_n)plot(fish_n)```