0

enter image description here

I'm new to r programing and I cant seem to figure out how to group rows with the same job title in this column. I attached a image for reference.

Lee Kuo
  • 23
  • 5
  • When I copy and pasted the question it left out the program used which is Jupyter r. – Lee Kuo Sep 10 '21 at 23:10
  • What would it mean to "group" them? What sort of structure to you hope to see at the end of the grouping process? – Aaron Montgomery Sep 10 '21 at 23:18
  • For example I would like to see "Senior Administrative Analyst" all in one row or "Pr Aministrative Analyst" in one row so it reduces the total number of rows. – Lee Kuo Sep 10 '21 at 23:32

1 Answers1

1

If what you want is a single vector with repeated entries discarded, try the unique() function, i.e. unique(data["Job"]). Note that this will discard how many of each there were and will result in a vector of shorter length than your original.

Aaron Montgomery
  • 1,387
  • 8
  • 11
  • Perfect! Now if I have another question that is some what related, should I just post another question or should I just post here again? – Lee Kuo Sep 11 '21 at 00:03
  • I think the typical thing to do is to open another question -- although as always, you might try searching for an answer among the existing questions first. Most likely, your question has been asked before. (Granted, it can be hard to find such solutions if you don't know the right terms to search.) Happy coding! – Aaron Montgomery Sep 11 '21 at 00:22