Skip to content

Commit 4be28d4

Browse files
committed
updated breeding.R + datasets
1 parent b854e32 commit 4be28d4

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
obs;hFather;hMother;midParent;HeightOffspring
2+
1;184;176;180;184
3+
2;174;160;167;175
4+
3;180;170;175;178
5+
4;171;159;165;172
6+
5;177;173;175;182
7+
6;184;175;179.5;181
8+
7;188;172;180;185
9+
8;180;164;172;178
10+
9;178;170;174;179
11+
10;175;163;169;172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
n,sire_kg,dam_kg,parent mid-point,kid_kg
2+
1,9225,9100,9163,9075
3+
2,8810,8900,8855,8225
4+
3,9600,9050,9325,9600
5+
4,9550,9750,9650,8960
6+
5,9300,8785,9043,8880
7+
6,8850,8955,8903,8475
8+
7,10150,9200,9675,9325
9+
8,10250,9450,9850,9900
10+
9,9700,10300,10000,9675
11+
10,9600,9400,9500,8900
12+
11,11025,10750,10888,9030
13+
12,10300,8880,9590,9700

introduction_to_animal_breeding/notebooks/breeding.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
################################################
2-
##Esercizi corso animal breeding di base ##
3-
################################################
1+
####################################################
2+
## Practicals: general intro to animal breeding ##
3+
####################################################
44

55
library("tidyverse")
66
library("data.table")
77

8-
## Combinazioni ##
8+
## Combinations ##
99

1010
n = 10
1111
k = (n/2)
@@ -52,8 +52,8 @@ sqrt(h2)
5252
##########################################
5353

5454
### PARENT MIDPOINT (example from the slides)
55-
56-
weight <- fread("data/weights.csv")
55+
base_folder = "/home/filippo/Documents/ciampolini/unipisa_2023/bioinformatics_and_biostatistics_training/introduction_to_animal_breeding"
56+
weight <- fread(file.path(base_folder, "data/weights.csv"))
5757

5858
x = weight$`parent mid-point`
5959
y = weight$kid_kg
@@ -89,7 +89,7 @@ se
8989

9090
### Another dataset #####
9191
## height
92-
height <- fread(file="data/height.csv")
92+
height <- fread(file=file.path(base_folder, "data/height.csv"))
9393

9494
# midParent #
9595
x = NULL

0 commit comments

Comments
 (0)