A factor is a type of variable that only accepts predefined values. So if you have the following factor :
fac <- factor(c("15","6","Low","23","39","Low"))
Then the predefinded set of values is :
R> levels(fac)
[1] "15" "23" "39" "6" "Low"
If you want to attribute "4"
as a velue, you either have to change your factor labels :
R> factor(fac, levels=c("15","23","39","6","Low"), labels=c("15","23","39","6","4"))
[1] 15 6 4 23 39 4
Or first convert it to a character vector :
R> v <- as.character(fac)
R> v[v=="Low"] <- "4"
R> v
[1] "15" "6" "4" "23" "39" "4"