I have a dataframe as shown below listing the number of injuries by vehicle type:
trqldnum <- data.frame(motorveh=c(796,912,908,880,941,966,989,984),
How about
sweep(trqldnum,2,unlist(trqldnum[1,]),"/")
?
The unlist is required to convert the first row of the data frame into a vector that can be swept ...
unlist