myamulla_ciencia
myamulla_ciencia

Reputation: 1488

Replace NA values in a R data frame

I have a column Total with about 300 values in a Data Frame, here first 30 values are NA’s .. and I would like to fill in these with a vector values c(233,423,545,354,223,646,243,553,634----231), do you have any suggestions for getting it done?.

Upvotes: 0

Views: 70

Answers (1)

arg0naut91
arg0naut91

Reputation: 14764

You could just do:

df[1:30, "Total"] <- yourvector

Upvotes: 3

Related Questions