How to build a crash course in R using AI

by Serena Purslow

I've spent the past week testing out some of the use cases and capabilities for AI, within the role of a data analyst. One of the things I was interested in, is the potential to use AI for training, both in terms of teaching others, and learning new skills yourself. I set myself the challenge of building a 2-day crash course in R, for an absolute beginner, using Chat GPT and Bard, two AI platforms.

Artificial Intelligence: what is it and what can it do?

AI stands for Artificial Intelligence, and effectively refers to the simulation of human processes by a machine. In general, AI computer systems are trained on existing data to understand patterns and use these to make future predictions. A lot of the data that AI tools such as Chat GPT are trained off in order to simulate human-like responses, are websites such as twitter and reddit. AI is constantly learning, and is very much in its early days. This means much caution must be taken when using AI responses, as they can often be incorrect, or reproduce existing biases within the data that the AI was trained on.

AI can be used for a wide range of things, from answering basic questions and translation, to generating text for chatbots and even writing code.

For this little project I chose to use Chat GPT and Bard in order to write my crash course, with the intention of comparing the two.

Chat GPT is a language processing AI model developed by Open AI. There is both a free and paid version of Chat GPT, which vary in capabilities. Bard is effectively Google's answer to Chat GPT, and is not quite as developed as Chat GPT yet.

Can AI build a Crash Course?

Before feeding any prompts into Chat GPT or Bard, I did a little research as to whether anyone had built a crash course using AI, and if so, how. The majority of what I found related to building a crash course with the objective of selling it, rather than actually using it to learn a new skill. A lot of blogs talked about using AI to build a course outline and material, and then create a marketing strategy in order to sell the course. I found less useful information on how to actually get AI to write the course content. With this in mind, I took to Chat GPT to test it out.

Building a Course using AI

To build a course using AI, I first planned out what things I wanted to include in my crash course, so that I'd have an idea as to what prompts to ask. I wanted to create a course outline and content with practice questions and examples. I also wanted to include a practical exam, revision cards, and extra resources for learning the content of the course.

I started out by asking Chat GPT the prompt 'I want to learn the basics of R in 2 days worth of content. Can you teach me?', to which I got a pretty extensive course outline. I tried asking Bard the same prompt, but only got an error back, so I tried a variety of similar prompts until I got one which worked, which ended up being 'Can you create a 2 day crash course for someone who wants to learn R?'. The Bard response wasn't as extensive as Chat GPT, however the general content included was very similar.

In both Chat GPT and Bard I went through each topic included in the course outline, and asked prompts such as 'can you expand in depth on data manipulation in R', and 'can you create a step by step guide for each topic, including practice questions and answers', in order to get the content for the course, as opposed to just the titles/outline. Again, the output from Chat GPT was much more cohesive than that from Bard, and the practice questions made a lot more sense too.

However, I did notice that whilst Bard would list sources at the end of responses, Chat GPT didn't, but there were a few occasions where the responses from Chat GPT were clearly sourced from a specific website/page. For example, the practical exam that Chat GPT created required the use of a dataset which Chat GPT wasn't then able to provide, despite me asking prompts to get the dataset. This seemed to indicate that Chat GPT was sourcing some of the information for it's responses from specific websites, which raises some questions regarding plagiarism. I actually ran all my output through plagiarism checkers with no cause for concern, but I'm not convinced that it's a black and white issue.

I ended up running 18 prompts through Chat GPT, and 16 through Bard, in order to get an output that I was more or less happy with (you can see a full list of these prompts at the end of this blog).

Results

Once I was happy with the general content of my 2 day crash course, I decided to put it to the test. I chose to use the Chat GPT version, as this seemed the most coherent and useful of the two.

All in all I found it pretty easy to follow, and was able to work through some of the examples. However, as I've used R before, it was hard to judge if the content was actually suitable for a complete beginner, or if my prior knowledge was helping me make sense of something that might not be so informative. I did get stuck on a few of the practice questions that had Chat GPT provided me with, and I tried to trouble shoot this using Chat GPT, with little luck. My suspicion is that the code Chat GPT gave me wasn't correct, as when I tried different code I ended up solving the problem.

The practical exam that I got Chat GPT to build also amused me due to it's very generous time giving for some of the questions. For a 1 hour practical exam, it suggested 10 minutes for questions which in reality would only take about 30 seconds to answer. However, the content of the exam still seemed pretty sound overall.

Conclusions

Can you use AI to create a crash course in a chosen topic? Yes. Should you rely on this as your only means of learning that topic? No. What I found over the course of this little project, was that Chat GPT, and AI in general is a powerful tool but shouldn't be relied upon. Ultimately I think it should be used as a complementary tool, to enhance learning and teaching, rather than being the focus. If you're looking to get started with learning something like R, then Chat GPT is a great place to start thinking about what topics/skills you should focus on, but it shouldn't be relied upon to provide the correct answers to every problem. If you're using it to answer questions that you don't have any prior knowledge of, then it has the potential to be misleading, hindering the learning process rather than helping it.

Comparing Chat GPT to Bard, I definitely noticed a big difference in ability. Chat GPT is certainly more advanced, and was able to answer a much wider range of prompts, and often responding with more relevant or in depth information. I did like that Bard provided sources in its responses, which made me feel a bit more confident about plagiarism issues. However, Bard was at times unable to respond to a prompt in relation to previous responses in the 'conversation'. Chat GPT on the other hand was very good at remembering the 'conversation, meaning its responses were better adapted in reference to previous prompts/responses.

All in all testing out AI to see if it could create a crash course for me was an eye opening experience in terms of seeing just how much AI can already do. Exciting but potentially scary things await!

Chat GPT Prompts:

  • I want to learn the basics of R in 2 days worth of content. Can you teach me?
  • Can you fully expand on each of those topics?
  • Can you create a step by step guide for each topic, including practice questions and answers?
  • Can you outline data visualisation best practices?
  • Can you create flashcards to revise each topic?
  • Can you write a 1 hour practical exam to test out these topics in R?
  • Can you provide me with the datasets needed for this exam?
  • What data should be in the data.csv file?
  • Can you provide answers to the 1 hour practical exam?
  • Can you expand in depth on an introduction to R
  • Can you expand in depth on installation and setup
  • Can you expand on R Syntax and Object in depth
  • Can you expand on data manipulation in depth
  • Can you expand on data visualisation in depth
  • Can you expand on control structures and functions in depth
  • Can you expand on statistical analysis in depth
  • Can you expand on packages and functions in depth
  • Can you provide me with extra resources on the content of the 2 day course in R, such as videos, blogs and websites?

Bard Prompts:

  • Can you create a 2 day crash course for someone who wants to learn R?
  • Can you fully expand on each of those topics?
  • Can you create a step by step guide with content and examples, for the topics ‘Introduction to R’ and include practice questions and examples?
  • Can you create a step by step guide with content and examples, for the topics ‘Data Types and Structures’ and include practice questions and examples?
  • Can you fully expand on data types and structures in R, providing the required code and examples?
  • can you further expand on how to use these in R
  • Can you create a step by step guide with content and examples, for the topics ‘Data input and Output’ and include practice questions and examples?
  • Can you create a detailed step by step guide with content and examples, for the topics ‘Data Manipulation’ and include practice questions and examples?
  • Can you further expand on data manipulation in R?
  • Can you create a detailed step by step guide with content and examples, for the topics ‘Data Analysis’ and include practice questions and examples?
  • Can you further expand on data analysis in R?
  • Can you create a detailed step by step guide with content and examples, for the topic ‘Data Visualisation’ and include practice questions and examples?
  • Can you expand further on data visualisation in R?
  • Can you create flashcards to revise each topic in the 2-day crash course in R?
  • Can you write a 1 hour practical exam to test out these topics in R?
  • Where can I find videos or blogs on the basics of R?