Re: [R] Identifying columns with specific character

2018-04-18 Thread Rui Barradas
Hello, To the OP: The dollar sign is a meta character, so it must be escaped, that is what was wrong with your code. The right regular expression would be grepl("\\$", x) When a regular expression doesn't work, try reading the help page ?regex. Another good source you can try is https://reg

Re: [R] Identifying columns with specific character

2018-04-18 Thread Jeff Newmiller
Your message came through all messed up because you did not tell your email program to use plain text format. This at best delays a responds and at worst prevents us from understanding your question as you intended. 1) The columns became factors when you created the data frame because you did n

Re: [R] Identifying columns with specific character

2018-04-18 Thread Jim Lemon
Hi Farnoosh, Perhaps this will help: drop_dollar<-function(x) return(as.numeric(as.character(gsub("\\$","",x sapply(My.Data,drop_dollar) Jim On Thu, Apr 19, 2018 at 7:23 AM, Farnoosh Sheikhi via R-help wrote: > Hello, > I have a data frame with 400 columns and wanted to filter character col