You can close your Registered Retirement Savings Plans (RRSP) and take cash (as long as the investments are liquid) before you retire. However, you should consider that you will pay an immediate withholding tax on the money you take out (10-30% depending on amount withdrawn), and possibly more at tax time (the amount taken out must be reported as income on your tax return).
An RRSP must be closed by the year you turn 71. Making RRSP withdrawals before you retire provides a quick look at the impact of dipping into your RRSP before retirement.
Speak to a financial representative to understand whether closing your RRSP is the best option for you or if there are other options you can consider.