Could you talk more about what you're trying to do here? Ideally with a reprex?
There's a nice discussion of this error on stack overflow, and in the documentation for R data.frames:
The replacement methods can be used to add whole column(s) by specifying non-existent column(s), in which case the column(s) are added at the right-hand edge of the data frame and numerical indices must be contiguous to existing indices. On the other hand, rows can be added at any row after the current last row, and the columns will be in-filled with missing values. Missing values in the indices are not allowed for replacement.
This likely means there's a missing value in your
Freq column of
Here's a reprex for this error.
x <- data.frame(a=c(NA,2:5), b=c(1:5))
#>  NA 2
x[x$a==2,]$b <- 99
Error in `[<-.data.frame`(`*tmp*`, x$a == 2, , value = list(a = c(NA, :
missing values are not allowed in subscripted assignments of data frames
Created on 2021-04-13 by the reprex package (v2.0.0)
I think a good path forward is to start your goal for this operation, what are you trying to do? With a reprex, folk here could probably suggest an alternative.