[R] non alphabetical strings

Graeme Davidson gr@eme@r@d@v|d@on @end|ng |rom gm@||@com
Sun Apr 28 20:53:48 CEST 2019


Hello All,

I can’t find the answer for this so I thought I would ask you lovely people. 

I have a data frame with a column of names, some of which have non-alphabetical letters.

How, do I extract the row indexes which do not meat the criteria of alphabetical [[:alpha:]].

Thanks in advance

All the best

Graeme 
   

library(dplyr)
my_df <- data.frame(name1 = c("david", "mo", "ma4tilda856", "steph", "hadley", "574383"),
                    name2 = c("craig", "salah", "dahl", "paris", "wick", "turing"), sex = c("m", "m", "f", "f", "m", "m”))
my_df %>%
  mutate_all(as.character)
	[[alternative HTML version deleted]]



More information about the R-help mailing list