When I try to select a data from the data matrix that I have created I receive an error, I would like that someone can help me out and fix it.
Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class "c('matrix', 'double', 'numeric')"
I have tried to call out the function by doing dplyr:: or by using some pipe operations mydata %>% filter(2010) or even installed and loaded package "conflicted" and gave the dplyr an priority but nothing works. I am new with r.
Matrix_5c_AVG_Year <- cbind(AVG_SWE_YEAR,AVG_NO[,2],AVG_FI[,2],AVG_EE[,2],AVG_LV[,2],AVG_LT[,2])
colnames(Matrix_5c_AVG_Year) <- c("Year","AVG_SWE1", "AVG_NO1", "AVG_FI1", "AVG_EE1", "AVG_LV1", "AVG_LT1")
mydata<-Matrix_5c_AVG_Year
mydata %>% filter(2010)
I would like to get an output of only the row of 2010 data and perferably be able to select only one header.