I'm still new in the R-Programming and am struggling with the following at the moment:
df <- tibble(
'VPN'= c(01, 02, 03, 04, 05),
'11'= c(1.12, 4.12,4.64, 0.72, 3.5),
'11x'= c(4, 6, 3,1, NA),
'12'= c(3.15, 4.68, 7.92, 5.83, 2.25),
'12x' = c(5, 7, 2, 2, 6),
'13' = c(2.26, 3.73, 4.54, 6.55, 1.72),
'13x' = c(8,3,2,5,9)
)
I want to replace e.g. the values in the columns 11/11x for VPN 1 and the values in the columns 13/13x for VPN 5 by NA.
I wonder whether I can achieve this by indexing?
I've already tried..
df1 <- df[df$11] <- NA
df1 <- df(df$11x) <- NA
..but this returns just a vector and not the original dataframe with changed values.
I'd be very happy to receive help. Thanks a lot !