I have a data frame called noNAN which has a list of 21 columns [class 0....class 20] which I have converted to a table of proportions for each row and saved this as 'percentagePrach'
percentagePrach <- round(prop.table(as.matrix(noNAN[,9:29]),1) *100, 1)
dimnames(percentagePrach) <- list(colnames(percentagePrach, do.NULL = FALSE, prefix = "% class "))
Error in dimnames(percentagePrach) <- list(colnames(percentagePrach, do.NULL = FALSE, :
length of 'dimnames'  not equal to array extent
Could I specify the column names in the original prop.table as an argument?
exactly there is the function
colnames(percentagePrach) <- c("newcolname1", "newcolname2", "newcolname3", ...)