How can I use check.names is false but still use the operator $

I have column names that contain brackets and spaces. I can import them using check.names = False.

However, after importing the subset function does not work anymore. I have tried the following codes

test <- subset (df$"model code" == graph)
test <- subset (df, "model code" == graph)
test <- subset (df

this is the error Error in subset.default(df$"model mode" == "graph") : argument "subset" is missing, with no default

**How can I use check.names is false but still use the operator $**model code' == graph)

this is the error Error in subset.default(df$"model mode" == "graph") : argument "subset" is missing, with no default

How can I use check.names is false but still use the operator $

Non-syntactic names must be enclosed within backticks. Try the code below.

test <- subset(df, `model code` == graph)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.