i'm new to R and below is my code but i cant knit the file to html because it says object of type 'closure' is not subsettable, how should I change my code?
mean(data$salary)
[1] 865.8644
how to change my code to let it works?
i'm new to R and below is my code but i cant knit the file to html because it says object of type 'closure' is not subsettable, how should I change my code?
mean(data$salary)
[1] 865.8644
how to change my code to let it works?
Check you code upstream, you're probably reassigning data
to something else.
When you knit a document, R executes everything sequentially, it might be the case that you're doing something like this.
data <- actual_dataframe
...
couple lines below
...
data <- 1
...
# then you hit your error
mean(data$salary)