Hello, I am new to R Studio. Here is my problem.
I have classified a raster image using the random forests classifier. I had a set of 19 tif images as a predictor variables. I have made the sampling in qgis 2.18. After I finish the classification I was trying to export the results in a tif format. But I am getting this error "Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘writeRaster’ for signature ‘"character", "character"’’.
Here is the code:
read samples data
factor tis katigorikes metavlites
#remove na data#
#sep training & ground truthing#
sep=sample(2,nrow(pointssamples), replace = TRUE, prob = c(0.7, 0.3))
plot(rf, main="Rate of error")
rf2=randomForest(Classes~.,data=train, ntree=300, mtry=8, importance=TRUE)
varImpPlot(rf2, main="Variable importance")
#export classified map##