i am trying to plot individual longitudinal growth trajectories for height data. i have 876 individuals and would like the trajectory for each individual. if i use the code below the graphs are so tiny as to be of no use. is there way of increasing the size of the graphs so they become visible.
a snippet of the data is given below.
| id_comb |
ht |
black |
female |
age |
| 203 |
148.1 |
0 |
1 |
9.804444992 |
| 203 |
154.2 |
0 |
1 |
10.68057523 |
| 203 |
162.8 |
0 |
1 |
11.76752432 |
| 203 |
169.7 |
0 |
1 |
12.777812 |
| 203 |
169.6 |
0 |
1 |
13.76619643 |
| 203 |
170.6 |
0 |
1 |
14.691609 |
| 203 |
171.9 |
0 |
1 |
15.77582017 |
| 203 |
172.1 |
0 |
1 |
16.6848053 |
| 203 |
171.1 |
0 |
1 |
17.69783089 |
| 203 |
172.5 |
0 |
1 |
18.82858649 |
| 203 |
172.1 |
0 |
1 |
22.14966769 |
| 207 |
137.1 |
0 |
1 |
9.790755457 |
| 207 |
146.0 |
0 |
1 |
10.93520059 |
| 207 |
157.8 |
0 |
1 |
12.90923154 |
| 207 |
162.7 |
0 |
1 |
13.96058783 |
| 207 |
164.2 |
0 |
1 |
14.92159319 |
| 207 |
165.5 |
0 |
1 |
16.04139715 |
| 207 |
166.0 |
0 |
1 |
17.31999973 |
| 207 |
165.7 |
0 |
1 |
18.10304113 |
| 208 |
132.2 |
0 |
0 |
9.911223365 |
| 349 |
148.5 |
1 |
1 |
12.80792898 |
| 349 |
152.1 |
1 |
1 |
14.15224132 |
| 349 |
152.8 |
1 |
1 |
14.71351226 |
| 349 |
152.4 |
1 |
1 |
15.54309808 |
| 349 |
153.9 |
1 |
1 |
16.58350274 |
| 349 |
153.8 |
1 |
1 |
17.72247206 |
| 349 |
153.3 |
1 |
1 |
18.73002183 |
the code i have used is below.
library(ggplot2)
library(nlme)
library(haven)
females_black <- read_sas("C:/Users/rchiruka/Desktop/phd r code/females_black.sas7bdat",
NULL)
ggplot(data=females_black,aes(x=age,y=ht))+geom_line() +facet_wrap(~id_comb,nrow=176,ncol=5, scales="free")