Aside from the error message, you should definitely not install packages every time you knit an Rmarkdown document. If I were you I would install the packages first, and take out the the install.packages() lines.
From the error message it seems there is an issue with installing tidyverse. Do you have a mirror set up for CRAN? Because it says you do not. That is basically the source R will try to get the package(s) from. This is the list of mirrors: CRAN - Mirrors. It's good practice to pick one closest to you. In RStudio, go to Tools -> Global Options -> Packages -> pick a repository (mirror)
I have visited attached link mentioned above and while installing of package i have been suggested by user to add another argument in install.packages("tidyverse", repos="https://cloud.r-project.org/") and now i am able to knit it . Suggest me wheather i am doing it right or else i have to do something else.
In the tools>global option>packages> primary repository by default selected to Global what else i need to change in order to work with my desktop version smoothly