Easier to convert nm to characters and then make the change:
junk$nm <- as.character(junk$nm)
junk$nm[junk$nm == "B"] <- "b"
EDIT: And if indeed you need to maintain nm as factors, add this in the end:
junk$nm <- as.factor(junk$nm)
More Related Contents:
- Recode categorical variable to binary (0/1)
- Idiom for ifelse-style recoding for multiple categories
- Canonical tidyverse method to update some values of a vector from a look-up table
- Extract rows based on only one column using R [closed]
- ggplot with 2 y axes on each side and different scales
- How to name variables on the fly?
- cbind a dataframe with an empty dataframe – cbind.fill?
- Repeat rows of a data.frame [duplicate]
- Expand rows by date range using start and end date
- Adding a column of means by group to original data [duplicate]
- Dummy variables from a string variable
- Split text string in a data.table columns
- Converting two columns of a data frame to a named vector
- R command for setting working directory to source file location in Rstudio
- Pretty ticks for log normal scale using ggplot2 (dynamic not manual)
- R help page as object
- Practical limits of R data frame
- How to convert time (mm:ss) to decimal form in R
- how to change the color in geom_point or lines in ggplot [duplicate]
- Convert a character vector of mixed numbers, fractions, and integers to numeric
- Options for caching / memoization / hashing in R
- R – Markdown avoiding package loading messages
- Simplified dput() in R
- How to append a whole dataframe to a CSV in R
- How to properly document S4 methods using roxygen2
- Run a custom function on a data frame in R, by group
- The perils of aligning plots in ggplot
- How to create a new variable in a data.frame based on a condition?
- Understanding element wise clearing of R’s workspace
- What does the %% operator mean in R? [closed]