r - How to filter an table by a value in row -


I am doing a script in r which is the csv file then To load my data I have to make these functions user

  data & lt; - read.csv ("info.csv", colClasses = "character")   

and my data looks like this

  abcd ... 1 "A" 3 4 ... 5 "b" 7 8 ... 9 "c" 7 4 ... 9 "c" 2 5 ... 9 "a" 1 6 ...   

How can I filter only "C" or "A" or both or any other string?

For only one, you can try:

Data Lonely and lieutenant; - Using the data [data $ B == "A",]

or subset () command:

Data For the A or C, you can use the % in% operator, and the Lieutenant-Subset (Data, B == "A")

Are: data.ac> lt; - Data [data is $ B% C ("A", "C"),] , or data.AC < - subset (data, B%% C ("A", "C"))

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -