csv – R coding question related to subsetting data

I know that I can subset data in R if I call: data((some condition),).

However, I have a CSV file where the first entry is the condition I want to subset for. If I call

data = read.csv("data.csv") # actual data
newFile = read.csv("Condition.csv") # csv file with one entry with the condition
firstCondition = newFile(1,1) ## Condition

subset = data(firstCondition, )

it doesn’t subset. I am realizing that firstCondition is of type “character” and this may be why it won’t subset. Does anybody have any ideas on what the issue here may be? Thanks!

subsetting in Logistic Regression in R

I received the following error messages when splitting and subsetting my data in the process of logistic regression in R:

Error: Must subset rows with a valid subscript vector.
i Logical subscripts must match the size of the indexed input.
x Input has size 333030 but subscript i has size 9.
Run rlang::last_error() to see where the error occurred.