After running installed.packages("swirl"), it displays the following error
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances
License License_is_FOSS License_restricts_use OS_type Archs MD5sum
NeedsCompilation Built
Can you send a screenshot of this error?

Try the following:
install.packages("swirl")
library(swirl)
swirl()
Still did not install

You're using the function installed.packages() when you should be using the function install.packages(). Please see my comment above for the canonical method of installing swirl.
Thank You
Most helpful comment
You're using the function
installed.packages()when you should be using the functioninstall.packages(). Please see my comment above for the canonical method of installing swirl.