Skip to content

Tag: data-manipulation

R: “Fuzzy Match” and “Between” Statements

I am working with the R Programming Language. I have the following tables (note: all variables appear as “Factors”): I am trying to “join” (e.g. inner join) this tables on the following conditions: 1) if table_1$id “fuzzy equal” table_2$id AND 2) if table_1$date BETWEEN(table_2$date_2,table_2$date_3) I tried to write the following code in R to do this: Question: But I am

Take last value in sequence

I am trying to insert data into my target table from my source table where in the target table I have an additional column called SaleTo. SaleTo = the SaleFrom based on the MAX SaleSequence. Example of the source table: SaleNo SaleFrom SaleSequence 1 Alabama 2 1 Minnesota 1 1 Virginia 3 Example of target table: SaleNo SaleFrom SaleSequence SaleTo