Posts

Showing posts from March, 2023

Integrating ChatGPT in R: A Comprehensive Guide

  Nirmal Ghimire, Ph.D. K-16 Literacy Center at University of Texas at Tyler 2023-03-03 Step 1: Get chatGPT API Step 2: Loading Required Libraries Step 3: Running chatGPT 3.a. Save chatGPT API an an Object 3.b. Use the Curl Command and Run the chatGPT 3.c. Clean the Output Using {stringr} 4. Putting Everything Together and Creating a Single Function 5. Testing the Single Funtion: “What are the difference between R and Python?” 6. Asking chatGPT How to Create a Simulated Data 7. Check If Data Set Can be Created Using Suggested Method 8. Running Regression 9. Asking chatGPT to Interpret Findings 10. Does chatGPT Draw? 11. And Finally … This is how I often set up my global options that help me keep my output nice and clean.  Click on the  Show Code  button to find the actual code. knitr :: opts_chunk $ set ( echo = TRUE , comment = NA , warning = FALSE , message = FALSE , tidy = 'styler