search for: inscompany_match

Displaying 3 results from an estimated 3 matches for "inscompany_match".

2011 Jun 14
1
Invalid Regular Expression
...Alaska 1 0 0 he lives in 66062 0 0 1 So basically, I'm generating a 1 if a phrase contains a state, city, or zip code, and 0 if it doesn't. Using the stringr package, I developed the following code: library(stringr) inscompany_match <- str_c(inscompany, collapse = "|") state_match <- str_c(state, collapse = "|") city_match <- str_c(city, collapse = "|") agency_match <- str_c(agency, collapse = "|") zipcode_match <- str_c(zipcode, collapse = "|") mydf$inscomp...
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
...4, d15, d16, d17, d18, d19, d20, d21, d22, d23, d24, d25, d26, d27, d28, d29, d30, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40, d41, d42, d43, d44, d45, d46, d47, d48, d49, d50, d51, d52, d53, d54, d55, d56, d57, d58, d59, d60, d61, d62, d63, d64, d65, d66, d67, d68, d69, d70) library(stringr) inscompany_match <- str_c(inscompany, collapse = "|") state_match <- str_c(state, collapse = "|") city_match <- str_c(city, collapse = "|") mydf$inscompany <- as.numeric(str_detect(mydf$keyword, inscompany_match)) mydf$state <- as.numeric(str_detect(mydf$keyword, state_m...
2011 Jun 09
2
Problem with a if statement inside a function
...d24, d25, d26, d27, d28, d29, d30, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40, d41, d42, d43, d44, d45, d46, d47, d48, d49, d50, d51, d52, d53, d54, d55, d56, d57, d58, d59, d60, d61, d62, d63, d64, d65, d66, d67, d68, d69, d70) library(stringr) inscompany_match <- str_c(inscompany, collapse = "|") state_match <- str_c(state, collapse = "|") city_match <- str_c(city, collapse = "|") mydf$inscompany <- as.numeric(str_detect(mydf$keyword, inscompany_match)) mydf$state <- as.numeric(str_dete...