for anyone who wanted to know what the hell the attr(, match.length) thing does, it can be used define the vector that describes the length of the matches. In case you have many matches and you wanna display each of them in a string you can label your gregexpr(blabla) as "matches". And that will give you the first vector (the one that tells you where each of your matches begins). matches
Is it possible to do a similar video but about mining data on DF? Like columns and row manipulation. Im having trouble for example when trying to match patterns of strings within rows of specific columns. Like considering only words starting with _ , ending with _ and starting with an empty space... Ive tried: filas = grep( df_diccionario$Palabra[i], df_busqueda$String) where Palabra is a column from my df_diccionario data frame and String is a Column of my df_busqueda dataframe. I want to find all the occurrences within Palabra, that matches the String, but with the condition that these occurrences are only words between the underscore _ , or that start with an underscore and ends with the empty space or that ends with an underscore .. Found you in coursera a while ago, you are great Mr Peng. :)
To get the file you can use this R command download.file("raw.githubusercontent.com/ahawker/data-analysis-coursera/master/HW4/homicides.txt","homicides.txt")
That is AWESOME. I have been struggling with regex for so long. Thank you
for anyone who wanted to know what the hell the attr(, match.length) thing does, it can be used define the vector that describes the length of the matches.
In case you have many matches and you wanna display each of them in a string you can label your gregexpr(blabla)
as "matches". And that will give you the first vector (the one that tells you where each of your matches begins).
matches
Very good presentation. I was your student in R programming course in coursera, and have always enjoyed your class.
Is it possible to do a similar video but about mining data on DF? Like columns and row manipulation. Im having trouble for example when trying to match patterns of strings within rows of specific columns. Like considering only words starting with _ , ending with _ and starting with an empty space...
Ive tried: filas = grep( df_diccionario$Palabra[i], df_busqueda$String) where Palabra is a column from my df_diccionario data frame and String is a Column of my df_busqueda dataframe.
I want to find all the occurrences within Palabra, that matches the String, but with the condition that these occurrences are only words between the underscore _ , or that start with an underscore and ends with the empty space or that ends with an underscore ..
Found you in coursera a while ago, you are great Mr Peng. :)
where can I download the data? There does not seem to be a link anywhere
To get the file you can use this R command
download.file("raw.githubusercontent.com/ahawker/data-analysis-coursera/master/HW4/homicides.txt","homicides.txt")
error
Excuse me, may i get the slide?
and use it for your own classes here?
Any slides available? good tutorial anyway
a very good tutorial.
very well explained
regexpr = reg expression..