Skip to content

Commit c3355f8

Browse files
tidy up
1 parent 76a8e5e commit c3355f8

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

vignettes/v5_ASOIAF.Rmd

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ df_repaired <- checkParentIDs(df_got,
174174
) %>% mutate(
175175
# famID = 1,
176176
affected = case_when(
177-
ID %in% c(jon_id, dany_id, "365") ~ 1,
178-
TRUE ~ 0
177+
ID %in% c(jon_id, dany_id, "365") ~ T,
178+
TRUE ~ F
179179
)
180180
)
181181
```
@@ -184,16 +184,22 @@ This code creates new IDs for individuals with one known parent and a missing ot
184184

185185
```{r}
186186
187-
checkIDs(df_repaired)
187+
checkIDs <- checkIDs(df_repaired, verbose = TRUE)
188+
189+
#checkIDs
190+
```
188191

189192

193+
```{r}
190194
# Check for unique IDs and parent-child relationships
191-
checkPedigreeNetwork(df_repaired,
195+
checkPedigreeNetwork<- checkPedigreeNetwork(df_repaired,
192196
personID = "ID",
193197
momID = "momID",
194198
dadID = "dadID",
195-
verbose = FALSE
199+
verbose = TRUE
196200
)
201+
202+
checkPedigreeNetwork
197203
```
198204

199205
As we can see, the repaired pedigree now has unique IDs for all individuals, and the parent-child relationships are intact. The function `checkIDs()` confirms that all IDs are unique, while `checkPedigreeNetwork()` verifies that there are no structural issues like individuals with more than two parents or cyclic relationships.
@@ -210,7 +216,8 @@ This function provides a more flexible and customizable way to visualize pedigre
210216
```{r eval=FALSE, fig.height=8, fig.width=10, message=FALSE, warning=FALSE, include=FALSE}
211217
plotPedigree(df_repaired %>% mutate(
212218
famID = 1
213-
), affected = df_repaired$affected, verbose = FALSE)
219+
), affected = df_repaired$affected,
220+
verbose = FALSE)
214221
```
215222

216223

@@ -220,21 +227,17 @@ library(ggpedigree)
220227
df_repaired_renamed <- df_repaired %>% rename(
221228
personID = ID
222229
)
223-
plt <- ggPedigree(df_repaired_renamed,
224-
status_col = "affected",
230+
plt <- ggpedigree(df_repaired_renamed,
231+
overlay_column = "affected",
225232
personID = "personID",
226233
interactive = FALSE,
227234
config = list(
228-
status_unaffected_lab = 0,
235+
overlay_include = TRUE,
229236
point_size = .75,
230237
code_male = "M",
231-
status_affected_lab = 1,
232-
affected_shape = 4,
233238
ped_width = 14,
234-
include_tooltips = TRUE,
235239
label_nudge_y = -.25,
236240
include_labels = TRUE,
237-
tooltip_include = TRUE,
238241
label_method = "geom_text",
239242
#segment_self_color = "purple",
240243
sex_color_include = FALSE,
@@ -244,6 +247,7 @@ plt <- ggPedigree(df_repaired_renamed,
244247
focal_fill_force_zero = TRUE,
245248
focal_fill_mid_color = "orange",
246249
focal_fill_low_color = "#9F2A63FF",
250+
focal_fill_legend_title = "Relatedness to \nRhaenyra Targaryen",
247251
focal_fill_na_value = "black",
248252
value_rounding_digits = 4
249253
))

0 commit comments

Comments
 (0)