This seems not to work, how can i accomplish this. i have attached a sample .csv dataset Affinity_Analysis.pdf (69.1 KB)
The expected output as a Data Table is as follows:
Its your own preference. He asked for a data table in question I have him a data table solution.
And you can use dplyr verbs with data.table as well. It will change the class from data.table to tibble and then you won't be able to use data.table syntax anymore but you can use dplyr all along. You can surely import a csv with fread without any side effects.
There is a new package called vroom if you want a faster operation on csv and fst if you want to store a large data set on computer. Definitely check those 2 as well.
He is talking about a Data Table in reference to the DT package to display tables on HTML pages or shiny apps (see tags for the topic), not a data.table.