I had multiple datasets with information about the day shift in the company like this:
Day1Set
name shift work_time
Worker1 1 8
Worker3 1 6
...
Day2Set
name shift work_time
Worker2 2 8
Worker3 2 6
...
Where "Workers" are unique employee names (strings) and all other information is numeric. Of course, I can merge them all into one dataset with an additional numeric variable describing the working day - if that matters.
And what I'm trying to do is change the form of the database: transpose rows and columns while sorting columns by employees and rows by dates (day number). As output I am interested in the following set:
Day Worker1_shift Worker1_time Worker2_shift Worker2_time Worker3_shift Worker2_time ...
1 1 8 - - 1 6
2 - - 2 8 2 6
...
where "-" means no data/NA. If it makes a difference, the number of employee names is known in advance and finite, the number of workdays is also known (I can convert them to dates or strings), so one can determine the size of the dataset in advance.
In Statistica, I had ETL modules so far, thanks to which I matched data by dates and variables, creating new datasets. I'm kinda new to R and honestly don't know where to start. I don't even know what phrases to look for - matching columns/rows, filling columns/rows; what modules, what libraries, and so on.
It would be enough for me even a hint in which threads or under what phrases to search, with the rest (I hope) I will manage somehow. If there is any simple method (even memory/proc consuming), I prefer it as a beginner.
Thanks in advance for your tips.