Reshape dont work for me

hello, help me please, the function reshape does not work for me, i like format my data frame to matrix , the lines are the transactionid and the columns are the productid, here is my code

library(tidyverse)
library(readxl)
library(knitr)
library(ggplot2)
library(lubridate)
library(arules)
library(arulesViz)
library(plyr)
retail <- read_excel('retail.xlsx')

2 colums transactionid , productid

retail_mat_prep <- reshape(data = retail,
idvar = "transactionid",
timevar = "productid",
direction = "wide")

dim(retail_mat_prep)

thank you

Hi @ninou,

First, please consider to use a reproducible example (reprex) in this question, that way it can be easy to help you: FAQ: What's a reproducible example (`reprex`) and how do I do one?

Besides that, reshape() is a function from base R. Have you tried to use the gather() and spread() functions from the tidyr package (which is part of the tidyverse)?