Error in R – Object of Type Closure is not Subsettable (Example Code)

In this R post you’ll learn how to fix the error object of type ‘closure’ is not subsettable.

Example: Fixing the Error: Object of Type ‘Closure’ is not Subsettable

mean[1:5]        # Using mean() function the wrong way
# Error in mean[1:5] : object of type 'closure' is not subsettable
mean(1:5)        # Proper usage of mean()
# [1] 3

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top