YouTube Video
Step 1: Download and Install R
Visit the R Project Website:
Open your browser and go to https://cran.r-project.org/.Choose a CRAN Mirror:
Click on a CRAN mirror close to your location (e.g., "0-Cloud [https]").Download the Windows Installer:
- Click on Download R for Windows.
- On the next page, click base under "Subdirectories".
- Click Download R x.x.x for Windows to download the
.exe
file.
Run the Installer:
- Locate the downloaded file (e.g.,
R-x.x.x-win.exe
) in your Downloads folder and double-click it.
- Locate the downloaded file (e.g.,
Install R:
- Language: Choose your preferred language and click OK.
- Setup Wizard: Follow the on-screen instructions:
- Accept the license agreement.
- Choose the installation path (default:
C:\Program Files\R\R-x.x.x
). - Select components (leave the defaults checked).
- Click Finish to complete the installation.
Step 2: Verify R Installation
- Open the Start Menu and search for R x64 x.x.x.
- Launch R and ensure it opens successfully.
- Test R by typing:
version
- This will display the installed R version details.
Step 3: Download and Install RStudio
Visit the RStudio Website:
Go to https://posit.co/download/rstudio-desktop/.Download RStudio:
- Under RStudio Desktop Open Source License, click the Download button for Windows.
- The
.exe
file (e.g.,RStudio-x.x.x.exe
) will start downloading.
Run the Installer:
- Locate the downloaded file in your Downloads folder and double-click it.
- Follow the installation wizard:
- Accept the license agreement.
- Choose the installation path (default:
C:\Program Files\RStudio
).
- Click Install and then Finish to complete the setup.
Step 4: Verify RStudio Installation
- Open the Start Menu and search for RStudio.
- Launch RStudio.
- RStudio should automatically detect your R installation.
- To confirm, go to Tools > Global Options in RStudio and check the R version under the General tab.
Step 5: Test RStudio
- In the Console pane of RStudio, type the following command:
print("R and RStudio are working!")
- Press Enter.
- If everything is set up correctly, the message will be displayed in the console.
Optional: Install R Packages
To enhance R’s functionality, install additional packages:
- Open RStudio.
- In the console, type:
install.packages("ggplot2")
- Press Enter to install the
ggplot2
package. - Once installed, load the package:
library(ggplot2)
Conclusion
You’ve successfully installed R and RStudio on Windows 11. With this setup, you’re ready to explore data analysis, statistical modeling, and visualization. RStudio provides a user-friendly interface that simplifies working with R, making it a great choice for beginners and advanced users alike. Happy coding and data analysis!
Comments
Post a Comment
Leave Comment