So i have a dataset of passwords and i would like to create a new column if the password matches one of the following strings (im working with R)
id password year lenght
1 1 12345 2001 5
2 2 pass4 2002 5
3 3 angel 2003 5
4 4 pizza 2004 5
pattern for passwords with only letters: "^[a-zA-Z]+$"
pattern for passwords with only numbers: "^[0-9]*$"
pattern for passwords with BOTH numbers and letters : '([0-9].[a-zA-Z])|([a-zA-Z].[0-9])'
So basically i would need a new column named : TYPE with 3 levels (numbers, letters or both)
what I need is this :
id password year lenght Type
1 1 12345 2001 5. numbers only
2 2 pass4 2002 5. both
3 3 angel 2003 5. letters only
4 4 pizza 2004 5. letters only