Best way to learn r and python
April 14, 2021 R is an increasingly popular programming language, particularly in the world of data analysis and data science. You may have even heard people say that it’s easy to learn R! But easy is relative. Learning R can be a frustrating challenge if you’re not sure how to approach it. If you’ve struggled to learn R or another programming language in the past, you’re definitely not alone. And it’s not a failure on your part, or some inherent problem with the language. Usually, it’s the result of a mismatch between what’s motivating you to learn and how you’re actually learning. This mismatch causes big problems when you’re learning any programming language, because it takes you straight to a place we like to call the cliff of boring. What is the cliff of boring? It’s the mountain of boring coding syntax and dry practice problems you’re generally asked to work through before you can get to the good stuff — the stuff you actually want to do. The cliff of boring is a metaphor, but it really can feel like you’re looking at this sometimes. Nobody signs up to learn a programming language because they love syntax. Yet many learning resources, from textbooks to online courses, are written with the idea that students need to master all of the key areas of R syntax before they can do any real work with it. This is the process that causes new learners to drop off in droves:
Is it any wonder that many people quit when this is the default learning experience? Don’t misunderstand me — there’s no way around learning syntax, in R or any other programming language. But there is a way to avoid the cliff of boring. It’s a shame that so many students drop off at the cliff, because R is absolutely worth learning! In fact, R has some big advantages over other language for anyone who’s interested in learning data science:
And of course, learning R can be great for your career. Data science is a fast-growing field with high average salaries (check out how much your salary could increase). And tons of companies and organizations use R for data science work! Here’s a very short sample of some of the companies using R (from Hired.com as of April 2021):
This list is just the tip of the iceberg — thousands and thousands of companies all across the globe hire people with R skills, and R is very in demand in academia and government, as well. Even from this short list, it’s clear that someone with R skills could work in almost any industry they wanted. Big tech, finance, video games, big pharma, insurance, fashion — every industry needs people who can work with data, and that means that every industry has use for R programming skills. So how can you get them? Step 1. Find Your Motivation for Learning RBefore you crack a textbook, sign up for a learning platform, or click play on your first tutorial video, spend some time to really think about why you want to learn R, and what you’d like to do with it.
Find something that motivates you in the process. This will help you define your end goal, and it will help you get to that end goal without boredom. Try to go deeper than “becoming a data scientist.” There are all kinds of data scientists who work on a huge variety of problems and projects. Are you interested in analyzing language? Predicting the stock market? Digging deep into sports statistics? What’s the thing you want to do with your new skills that’s going to keep you motivated as you work to learn R? Pick one or two things that interest you and that you’re willing to stick with. Gear your learning towards them and build projects with your interests in mind. Figuring out what motivates you will help you figure out an end goal, and a path that gets you there without boredom. You don’t have to figure out an exact project, just a general area you’re interested in as you prepare to learn R. Pick an area you’re interested in, such as:
Create three-dimensional data visualizations in R with rayshader Step 2. Learn the Basic SyntaxUnfortunately, there’s no way to completely avoid this step. Syntax is a programming language is even more important than syntax in human language. If someone says “I’m the store going to,” their English-language syntax is wrong, but you can probably still understand what they mean. Unfortunately, computers are far less forgiving when they interpret your code. However, learning syntax is boring, so your goal must be to spend as little time as possible doing syntax learning. Instead, learn as much of the syntax as you can while working on real-world problems that interest you so that there’s something to keep you motivated even though the syntax itself isn’t all that exciting. Here are some resources for learning the basics of R:
The quicker you can get to working on projects, the faster you will learn R. You can always refer to a variety of resources for learning and double-checking syntax if you get stuck later. But your goal should be to spend a couple of weeks on this phase, at most. The RStudio Cheatsheets are great reference guides for R syntax: Step 3. Work on Structured ProjectsOnce you’ve got enough syntax under your belt, you’re ready to move on to structured projects more independently. Projects are a great way to learn, because they let you apply what you’ve already learned while generally also challenging you to learn new things and solve problems as you go. Plus, building projects will help you put together a portfolio you can show to future employers later down the line. You probably don’t want to dive into totally unique projects just yet. You’ll get stuck a lot, and the process could be frustrating. Instead look for structured projects until you can build up a bit more experience and raise your comfort level. If you choose to learn R with Dataquest, this is built right into our curriculum — nearly every one of our data science courses ends with a guided project that challenges you to synthesize and apply what you’re learning. These projects provide some structure, so you’re not totally on your own, but they’re more open-ended than regular course content to allow you to experiment, synthesize your skills in new ways, and make mistakes. If you’re not studying with Dataquest, there are plenty of other structured projects out there for you to work on. Let’s look at some good resources for projects in each area: Data science / Data analysis
Data visualization
Predictive modeling / machine learning
Statistics
Reproducible reports
Dashboard reports
Step 4. Build Projects on Your OwnOnce you’ve finished some structured projects, you’re probably ready to move on to the next stage of learning R: doing your own unique data science projects. It’s hard to know how much you’ve really learned until you step out and try to do something by yourself. Working on unique projects that interest you will give you a great idea not only of how far you’ve come but also of what you might want to learn next. And although you’ll be building your own project, you won’t be working alone. You’ll still be referring to resources for help and learning new techniques and approaches as you work. With R in particular, you may find that there’s a package dedicated to helping with the exact sort of project you’re working on, so taking on a new project sometimes also means you’re learning a new R package. What do you do if you get stuck? Do what the pros do, and ask for help! Here are some great resources for finding help with your R projects:
What sorts of projects should you build? As with the structured projects, these projects should be guided by the answers you came up with in step 1. Work on projects and problems that interest you. If you’re interested in climate change, for example, find some climate data to work with and start digging around for insights. It’s best to start small rather than trying to take on a gigantic project that will never get finished. If what interests you most is a huge project, try to break it down into smaller pieces and tackle them one at a time. Here are some ideas for projects that you can consider:
Here are some more project ideas in the topic areas that we’ve discussed: Data science / Data analysis
Data Visualization
Predictive modeling / machine learning
Statistics
Reproducible reports
Dashboard reports
Think of the projects like a series of steps — each one should set the bar a little higher, and be a little more challenging than the one before. Step 5. Ramp Up the DifficultyWorking on projects is great, but if you want to learn R then you need to ensure that you keep learning. You can do a lot with just data visualization, for example, but that doesn’t mean you should build 20 projects in a row that only use your data visualization skills. Each project should be a little tougher and a little more complex than the previous one. Each project should challenge you to learn something you didn’t know before. If you’re not sure exactly how to do that, here are some questions you can ask yourself to apply more complexity and difficulty to any project you’re considering:
Never Stop Learning RLearning a programming language is kind of like learning a second spoken language — you will reach a point of comfort and fluency, but you’ll never really be done learning. Even experienced data scientists who’ve been working with R for years are still learning new things, because the language itself is evolving, and new packages make new things possible all the time. It’s important to stay curious and keep learning, but don’t forget to look back and appreciate how far you’ve come from time to time, too. Learning R is definitely a challenge even if you take this approach. But if you can find the right motivation and keep yourself engaged with cool projects, I think anybody can reach a high level of proficiency. We hope this guide is useful to you on your journey. If you have any other resources to suggest, please let us know! And if you’re looking for a learning platform that integrates these lessons directly into the curriculum, you’re in luck, because we built one. Our Data Analyst in R path is an interactive course sequence that’s designed to take anyone from total beginner to job-qualified in R and SQL. And all of our lessons are designed to keep you engaged by challenging you to solve data science problems using real-world data. Ready to level up your R skills?Our Data Analyst in R path covers all the skills you need to land a job, including:
There's nothing to install, no prerequisites, and no schedule. Common R Questions:Is it hard to learn R?Learning R can certainly be challenging, and you’re likely to have frustrating moments. Staying motivated to keep learning is one of the biggest challenges. However, if you take the step-by-step approach we’ve outlined here, you should find that it’s easy to power through frustrating moments, because you’ll be working on projects that genuinely interest you. Can you learn R for free?There are lots of free R learning resources out there — here at Dataquest, we have a bunch of free R tutorials and our interactive data science learning platform, which teaches R, is free to sign up for and includes many free lessons. The internet is full of free R learning resources! The downside to learning for free is that to learn what you want, you’ll probably need to patch together a bunch of different free resources. You’ll spend extra time researching what you need to learn next, and then finding free resources that teach it. Platforms that cost money may offer better teaching methods (like the interactive, in-browser coding Dataquest offers), and they also save you the time of having to find and build your own curriculum. Can you learn R from scratch (with no coding experience)?Yes. At Dataquest, we’ve had many learners start with no coding experience and go on to get jobs as data analysts, data scientists, and data engineers. R is a great language for programming beginners to learn, and you don’t need any prior experience with code to pick it up. Nowadays, R is easier to learn than ever thanks to the tidyverse collection of packages. The tidyverse is a collection of powerful tools for accessing, cleaning, manipulating, analyzing, and visualizing data with R. This Dataquest tutorial provides a great introduction to the tidyverse. How long does it take to learn R?Learning a programming language is a bit like learning a spoken language — you’re never really done, because programming languages evolve and there’s always more to learn! However, you can get to a point of being able to write simple-but-functional R code pretty quickly. How long it takes to get to job-ready depends on your goals, the job you’re looking for, and how much time you can dedicate to study. But for some context, Dataquest learners we surveyed in 2020 reported reaching their learning goals in less than a year — many in less than six months — with less than ten hours of study per week. Do you need an R certification to find work?We’ve written about certificates in depth, but the short answer is: probably not. Different companies and industries have different standards, but in data science, certificates don’t carry much weight. Employers care about the skills you have — being able to show them a GitHub full of great R code is much more important than being able to show them a certificate. Is R a good language to learn in 2021?Yes. R is a popular and flexible language that’s used professionally in a wide variety of contexts. We teach R for data analysis and machine learning, for example, but if you wanted to apply your R skills in another area, R is used in finance, academia, and business, just to name a few. Moreover, R data skills can be really useful even if you have no aspiration to become a full-time data scientist or programmer. Having some data analysis skills with R can be useful for a wide variety of jobs — if you work with spreadsheets, chances are there are things you could be doing faster and better with a little R knowledge. How much money do R programmers make?This is difficult to answer, because most people with R skills work in research or data science, and they have other technical skills like SQL, too. Ziprecruiter lists the average R developer salary as $130,000 in the US (as of April 2021). The average salary for a data scientist is pretty similar — $121,000 according to Indeed.com as of April 2021. Should I learn base R or tidyverse first?This is a popular debate topic in the R community. Here at Dataquest, we teach a mix of base R and tidyverse methods in our Introduction to Data Analysis in R course. We are big fans of the tidyverse because it is powerful, intuitive, and fun to use. But to have a complete understanding of tidyverse tools, you’ll need to understand some base R syntax and have an understanding of data types in R. For these reasons, we find it most effective to teach a mix of base R and tidyverse methods in our introductory R courses. I needed a resource for beginners; something to walk me through the basics with clear, detailed instructions. That is exactly what I got in Dataquest’s Introduction to R course.
Is R and Python easy to learn?Both Python and R are considered fairly easy languages to learn. Python was originally designed for software development. If you have previous experience with Java or C++, you may be able to pick up Python more naturally than R. If you have a background in statistics, on the other hand, R could be a bit easier.
Can I learn both R and Python?Do not choose between R & Python, learn both. In general, you shouldn't be choosing between R and Python, but instead should be working towards having both in your toolbox. Investing your time into acquiring working knowledge of the two languages is worthwhile and practical for multiple reasons.
How long does it take to learn R and Python?It takes 4-6 weeks to learn R without programming knowledge. For those with programming experience, it takes only about 2 weeks. The learning duration for R will vary depending on previous programming experience, learning time commitment, having the right resources, digital literacy, and exposure to coding projects.
Is learning R or Python better?R is a statistical language used for the analysis and visual representation of data. Python is better suitable for machine learning, deep learning, and large-scale web applications. R is suitable for statistical learning having powerful libraries for data experiment and exploration.
|