I have a dataset in which each row is a minister ID, for each row I have columns with the date (day, month, and year) the minister entered the government (begin) and exit the government (exit). This is a sample on how it looks like right now: 
[![Original](https://i.stack.imgur.com/VP6jG.png)](https://i.stack.imgur.com/VP6jG.png)

```
data <- structure(list(id_min = c("1030015", "1030028"), begin_day = c("29", 
"4"), begin_month = c("12", "1"), begin_year = c("2019", "2020"
), exit_day = c("3", "10"), exit_month = c("1", "1"), exit_year = c("2020", 
"2020")), row.names = c(NA, -2L), class = c("data.frame"))

```

I want to expand the rows between the "begin date" and "exit date", and also create a new column (number\_days) counting the number of days the minister was in the government. The other variables in the dataset (omitted here) should just be repeated in the expanded version of the data). This is the data frame output I am looking for: 
[![Output dataframe](https://i.stack.imgur.com/ZJnG3.png)](https://i.stack.imgur.com/ZJnG3.png)

I was able to put the dates together in the format %Y-%m-%d, and create the new column "number\_days" with the following codes

```
data$begin_date <- as.Date(with(data, paste(begin_year, begin_month, begin_day,sep="-")), "%Y-%m-%d")
data$exit_date <- as.Date(with(data, paste(exit_year, exit_month, exit_day,sep="-")), "%Y-%m-%d")
data$number_days <- data$exit_date - data$begin_date

```

But I am not having success expanding the rows between the two dates (begin\_date and exit\_date). I was trying to do it using `tidyr::complete()`.