Is there any way of skipping data frame name all the time whenever I use a column name?
Example: lmc[lmc$BranchID=="NULL",]
Instead I want to write like
lmc[BranchID=="NULL",]
Is there any way of skipping data frame name all the time whenever I use a column name?
Example: lmc[lmc$BranchID=="NULL",]
Instead I want to write like
lmc[BranchID=="NULL",]
You can use attach
:
df <- data.frame(BranchID = c(1, "NULL", "hey"), value = 1:3, stringsAsFactors = FALSE)
attach(df)
df[BranchID == "NULL",]
BranchID value
2 NULL 2
Be carefull to not use a variable with the same name than the columns of your dataframe.