I'm very new to R and was wondering if it was possible to create a data frame in which values of columns are dependent on one another. I would like to start with a value of 0 for B, and use this to calculate C and D, then use C and D to calculate the next B value and so on for 51 rows. Code below is just to clarify what I'm trying to accomplish.
df=data.frame(
"A"=c(0:50),
"B"=c(B+C-D),
"C"=c(B*2),
"D"=c(B/2))