I am new to R and I have 2 questions:
I would like to import an excel file as a dataframe and at the same time adding a new column to dataframe that would include the Excel file name. Eg. the Excel file name is A_2011.xlsx and I would like to create a new column ("filename") in a dataframe = A_2011 by extracting it from Excel file name.
Given that I have a multiple dataframes in my environment and I want to create a function that will add a new column "FILE" to all dataframes in my environment and the value in the column FILE would be equal to each dataframe´s name as follows:
dataframes: column "FILE"
A_1 A_1
A_2 A_2
A_3 A_3
A_4 A_4