r - Remove duplicated rows -
i have read csv
file r data.frame. of rows have same element in 1 of columns. remove rows duplicates in column. example:
platform_external_dbus 202 16 google 1 platform_external_dbus 202 16 space-ghost.verbum 1 platform_external_dbus 202 16 localhost 1 platform_external_dbus 202 16 users.sourceforge 8 platform_external_dbus 202 16 hughsie 1
i 1 of these rows since others have same data in first column.
just isolate data frame columns need, use unique function :d
# in above example, need first 3 columns deduped.data <- unique( yourdata[ , 1:3 ] ) # fourth column no longer 'distinguishes' them, # they're duplicates , thrown out.
Comments
Post a Comment