in Education by
How can I remove rows which are duplicate in a column. I have read csv file into R data.frame. For ex. platform_external_dbus 303 27 Yahoo 2 platform_external_dbus 303 27 Local.files 2 platform_external_dbus 303 27 host 2 platform_external_dbus 303 27 users.sourcefiles 9 platform_external_dbus 303 27 distress 2 I just want to delete one of the rows above and there is same data in first column. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Perform this function after isolating your data frame to the columns you want to keep. # in your example, you only need the first two columns deduped.data <- unique( data[ , 1:2 ] ) # the third column no longer 'distinguishes' them, # so they're duplicates and deleted.

Related questions

0 votes
    Can someone tell me a function which can return a specified no. of rows picked randomly without any replacement from a DataFrame in R? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I want to bind two data frames with different set of columns and I also want to retain all the columns that fails to ... do that in R? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Is there a built-in that removes duplicates from a list in Python, whilst preserving order? I know that I can ... idiom if possible. Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    There is a DataFrame from pandas: import pandas as pd inp = [{'e2':20, 'e3':200}, {'e2':22,'e3':220}, { ... '] Can I do this in Pandas? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I want a way to create a empty data.frame in R, I just want to point out data types for each column and name it without any row created. df...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I have file called q.r and it has chmod of 755, how can I run it using a command-line? sayHello...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I work on Mac OSX and want to install a RJSONIO package in my R, I am a beginner currently and I have no ... someone explain it to me? Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    How can I merge and combine two values in R? For instance: tmp = cbind("QWE", "RT") tmp # [,1] [,2] # ... ,RT" How can I perform this? Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    How can I check for missing packages and call for installed.packages() to install them smartly? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I am ploating simple linear regression plot in R and I want to save it as JPEG or PNG file, How can I do ... it is, Is it possible? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    How to write a trycatch code to sort out an error in web downloading. url...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I want to supply some command-line parameters from a R script I have. And it runs on windows. I just want it ... help me with it? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Is there any shortcut method to find an index of an element in a vector, I have an element Q with me ... someone answer this doubt? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    What does startup profiles of R professionals include, I have no customization in R and I want to add some. ... highlight my syntax. Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I want to set some global variables inside a function, how can I do that? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
...