I need to modify in R my dataset that looks like a classic table with observations in the row and variables in the column. Specifically, the first column reports a set of transactions identified by an ID code (InvoiceNo)and the second column represents the description of product. I reproduce below the image of the dataset as it appears.

Specifically, my intent is to obtain a table that lends itself to be used for a market basket analysis where by row you have the different transactions (InvoiceNo) and by column the different attributes (Description). In other words I want to get binary data indicating the presence or absence of that specific product (reported in the column Description) in that specific transaction. I reproduce below the image of the dataset as I would like it to look:

You can use
pivot_widerfromtidyr.Creating a dataset with the same structure as yours:
Applying function: