0

I have a data frame containing many columns and I want to query data in a particular row of a column (say row1, column A) corresponding to value in another column (row1, column B).

How is this done in R?

MLavoie
  • 9,671
  • 41
  • 36
  • 56
Samrat
  • 1
  • `df[df$A == 'something',]`... – Sotos Jan 28 '20 at 10:14
  • Welcome to [so]! Please give a [mre] in your question! – jogo Jan 28 '20 at 10:15
  • Maybe? `df1$colA[ 1 ] == df1$colB[ 1 ]` – zx8754 Jan 28 '20 at 10:17
  • to add further, suppose we have two columns A and b , as shown: – Samrat Jan 29 '20 at 02:52
  • means, i have two columns- "value" and "day"". i need to create a new column "previous day average"which would use the excel formula of AVERAGEIFS to select the value from "value" column and from Day Column criteria is day<- day -1, i.e I need to find the value for previous day – Samrat Jan 29 '20 at 07:24

0 Answers0