Skip to content

Instantly share code, notes, and snippets.

View yahiaelgamal's full-sized avatar

Yahia yahiaelgamal

View GitHub Profile
@yahiaelgamal
yahiaelgamal / regex_snippets.R
Last active October 4, 2016 09:34
Cool Regex
# removes the table name from hive exporeted dataframe
gsub('.*?\\.(.*)' , '\\1', 'tablename.columnaname.suffix') # => columnaname.suffix
remove_table_name = function(df) {
names(df) = gsub('.*?\\.(.*)' , '\\1', names(df)) # => columnaname.suffix
df
}
# GTEST of two vectors (range 0, 1)
@yahiaelgamal
yahiaelgamal / egypt_pop_2006.csv
Created March 21, 2017 20:55
egypt population 2006
gov population
Alexandria 4716000
Aswan 1395000
Asyout 4123000
Beheira 5647000
Beni-Suef 2771000
Cairo 9102000
Dakahlia 5818000
Damietta 1301000
El Wadi Elgedid 220000