Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要替换数据框中多个单元格的内容。举个例子,我将mtcars如何替换 vs 列中包含1的任何单元one格?
mtcars
1
one
mtcars$vs[mtcars$vs == 1] <- "one"
或者
mtcars[mtcars$vs == 1, "vs"] <- "one"
像这样的东西: