R Copy one dataframe to another using data dictionary

22 views Asked by At

I'm looking create a function to copy the data from an incoming data file to a new data frame using a data dictionary. If I could schedule the mapping using a dataframe, it would be widely reusable with just the edit of a mapping table (a table would work too)

For exmaple, The incoming file would have these headers:

Number Name Desc Col S Mat Web Cost

and I want to map them to(This dataframe has additional Columns not in the incoming dataset that won't be matched):

SKU Title Description Img Color Size Material URL Price Shipping Weight Height Width...

Using the dataframe: (blanks have no incoming field to map)

Old New
Number SKU
Name Title
Desc Description
Img Img_URL
Col Color
S Size
Mat Material
Web URL
Cost Price
Shipping
Weight
Height
Width
Length
Alternative_Images
Category

Is there a library that does this kind of thing? If not, other suggestions will be very helpful.

0

There are 0 answers