Answers.Body: <p>You can simply use subset function in R and use the code given below,</p>
  <pre><code>    new_dataframe &lt;- 
      subset(name_of_your_dataframe,Column1 == 1 &amp;&amp; 
      Column2 ==  &quot;T1&quot;)
  </code></pre>
  <p>Please keep in mind that R is case sensitive and you should be careful while using the variable names.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-20T20:18:32.877Z
Answers.LastActivityDate: 2020-12-20T20:18:32.877Z
Answers.UserDisplayName: Ammar Sabir Cheema
Body: <p>I have  a data frame that contain lot of columns and lines, like this for example</p>
  <pre><code>Column1   Column2 
  5            T1
  1            T2
  1            T3
  1            T1
  2            T1
  1            T1
  2            T1
  1            T1
  </code></pre>
  <p>I want to extract just lines that have the value 1 in column 1 and Value T1 in Column 2</p>
  <p>So the result I want is</p>
  <pre><code>Column1   Column2 
  1            T1
  1            T1
  1            T1
  </code></pre>
  <p>Can you tell me please how I can do that</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T19:16:03.130Z
Comments.Text: Hi @James what code have you written so far? You must have imported into R and done some basic dataframe work.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T20:08:18.003Z
Comments.Text: Hello , thank you very much for you answer , yes i tried this one : Pokemon_2 <- dropRows(ds, Pokemon$Generation == 1 , Pokemon$Type_1=="Water" )   but it didn't work  , Error in dropRows(ds, Pokemon$Generation == 1, Pokemon$Type_1 == "Water") : 
    could not find function "dropRows"
Comments.UserDisplayName: Reda
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T20:27:59.883Z
Comments.Text: You should look at the `subset` function. Please google "filter data frame by column value" - much like writing `for` loops in basic programming languages, it is a basic operation that does not warrant creating new posts on forums.
Comments.UserDisplayName: Ram RS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T20:28:37.223Z
Comments.Text: I’m voting to close this question because it is a basic R operation has nothing to do with bioinformatics specifically
Comments.UserDisplayName: Ram RS
Tags: <r><database>
Title: How to select specific lines and specific columns
ThreadText: # How to select specific lines and specific columns
  
  (Asked by: username_0 on 2020-12-20)
  
  I have a data frame that contain lot of columns and lines, like this for example
  
  ```
  Column1   Column2 
  5            T1
  1            T2
  1            T3
  1            T1
  2            T1
  1            T1
  2            T1
  1            T1
  
  ```
  
  I want to extract just lines that have the value 1 in column 1 and Value T1 in Column 2
  
  So the result I want is
  
  ```
  Column1   Column2 
  1            T1
  1            T1
  1            T1
  
  ```
  
  Can you tell me please how I can do that
  
  **Tags:** r, database
  
  > **Comments:**
  > **username_1**: Hi @James what code have you written so far? You must have imported into R and done some basic dataframe work.  
  > **username_0**: Hello , thank you very much for you answer , yes i tried this one : Pokemon_2 <- dropRows(ds, Pokemon$Generation == 1 , Pokemon$Type_1=="Water" )   but it didn't work  , Error in dropRows(ds, Pokemon$Generation == 1, Pokemon$Type_1 == "Water") :    could not find function "dropRows"  
  > **username_2**: You should look at the `subset` function. Please google "filter data frame by column value" - much like writing `for` loops in basic programming languages, it is a basic operation that does not warrant creating new posts on forums.  
  > **username_2**: I’m voting to close this question because it is a basic R operation has nothing to do with bioinformatics specifically  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-12-20. Score: 2
  
  You can simply use subset function in R and use the code given below,
  
  ```
      new_dataframe <- 
      subset(name_of_your_dataframe,Column1 == 1 && 
      Column2 ==  "T1")
  
  ```
  
  Please keep in mind that R is case sensitive and you should be careful while using the variable names.
  
  
  ---
  
  