Skip to content
R for the Rest of Us Logo

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

Take a look at your data in the following ways:

  1. In the console by typing penguins_data

  2. Using the glimpse() function

  3. With the RStudio viewer (or using the view() function)

  4. With one of the functions I showed from the packages that I demonstrated:

    • skim() from the skimr package

    • tbl_summary() from the gtsummary package

    • makeDataReport() from the dataReporter package

    • scan_data() from the pointblank package

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Brittany Ripper

Brittany Ripper

September 14, 2023

This is the text that was generated after I identified the library and typed the "makeDataReport" function. A word file was generated instead of a pdf as shown in the video. Was there a problem with my code?

> library(dataReporter)

Attaching package: ‘dataReporter’

The following object is masked from ‘package:dplyr’:

    summarize

> makeDataReport(penguins_data)
The default of 'doScale' is FALSE now for stability;
  set options(mc_doScale_quiet=TRUE) to suppress this (once per session) message
Data report generation is finished. Please wait while your output file is being rendered.


 Is dataReporter_penguins_data.docx open on your computer? Please close it as fast as possible to avoid problems!

David Keyes

David Keyes Founder

September 14, 2023

Nothing wrong with your code! I don't know why it generated a Word document for you (to be honest, I never personally use the dataReporter package). However, it looks like there is an output argument you can use to change the output format. This will produce a PDF:

makeDataReport(penguins_data, output = "pdf")

Let me know if that helps!

I had the same issue, and inserted output = "pdf" and got this error. Perhaps it's because I don't have a LaTex viewer on my computer?

library(dataReporter) makeDataReport(penguins_data, output = "pdf") Data report generation is finished. Please wait while your output file is being rendered.

Is dataReporter_penguins_data.pdf open on your computer? Please close it as fast as possible to avoid problems!

Error: LaTeX failed to compile dataReporter_penguins_data.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. In addition: Warning message: In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) : '"pdflatex"' not found

David Keyes

David Keyes Founder

September 14, 2023

Yes, I think that's right.

Konul Karimova

Konul Karimova

February 21, 2024

Hi! I had the same problem. How did you solve it?

David Keyes

David Keyes Founder

February 22, 2024

I've never looked into this very deeply because I don't use the dataReporter package in my own work. However, if you want to make it work, I'd recommend checking out the tips on this page.

Jessica France

Jessica France

September 14, 2023

Hello David. After using the scan_data function, I get this message

"Error: The `interactions` and `correlations` sections require the ggforce package:
* It can be installed with `install.packages("ggforce")`." 

This seems to imply that I install the ggforce package first. Since you did not mention anything about a ggforce package, I do no know if this poses as a problem. Thanks.

David Keyes

David Keyes Founder

September 14, 2023

Sorry, I didn't realize you would need to install another package. Yes, you can install it safely!

Jessica France

Jessica France

September 18, 2023

Thank you!

When I ran the scan with pointblank, I got an error message saying the "interactions" and "correlations" requires the ggforce package. I installed that, so I was able to move forward, but not sure if that signifies a wrong step somewhere else, or something else going on. Here's the output:

library(pointblank) scan_data(penguins_data) Error: The interactions and correlations sections require the ggforce package:

  • It can be installed with install.packages("ggforce").

David Keyes

David Keyes Founder

September 30, 2023

I didn't realize this when I made the video, but it seems like you need to also install the ggforce package to use pointblank. You can do that by running install.packages("ggforce") in the console. Let me know if that solves your problem!

Samreen Chhabra

Samreen Chhabra

October 13, 2023

Hi David! My DataReporter code doesn't seem to be running the right way, I'm getting this- could not find function "makeDataReport"

David Keyes

David Keyes Founder

October 14, 2023

You almost certainly forgot to run library(dataReporter) first.

Samreen Chhabra

Samreen Chhabra

October 13, 2023

Also, for the scan_data command, I'm getting this-

  • It can be installed with install.packages("ggforce").

Samreen Chhabra

Samreen Chhabra

October 13, 2023

Okay this might work with ggforce, I seem to have run into a bigger problem- My RStudio software abruptly aborted R, and now says, "The object no longer exists" for penguins_data.

David Keyes

David Keyes Founder

October 14, 2023

Yes, it does seem that you need the ggforce package. Please install it with install.packages("ggforce").

David Keyes

David Keyes Founder

October 14, 2023

I'm not sure what's happening, but please send a screen recording and I can take a look.

Charles Obiorah

Charles Obiorah

February 29, 2024

  1. I have tried to install the packages. Why does the report come back to me WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

  2. All the packages I tried installing failed. ie skimr,, gtsummary, dataReporter, and makeDataRport. I must note that whhen the first packaged failed, i got the following message: Warning in install.packages : download of package ‘gtsummary’ failed package ‘Rcpp’ successfully unpacked and MD5 sums checked package ‘V8’ successfully unpacked and MD5 sums checked package ‘reactR’ successfully unpacked and MD5 sums checked package ‘labelled’ successfully unpacked and MD5 sums checked package ‘bigD’ successfully unpacked and MD5 sums checked package ‘bitops’ successfully unpacked and MD5 sums checked package ‘commonmark’ successfully unpacked and MD5 sums checked package ‘htmlwidgets’ successfully unpacked and MD5 sums checked package ‘juicyjuice’ successfully unpacked and MD5 sums checked package ‘markdown’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\Obiorah\AppData\Local\Temp\RtmpOIxcZ1\downloaded_packages

  1. So what are the binary packages that are above
  2. what may have caused the failures

David Keyes

David Keyes Founder

February 29, 2024

Despite all of this, I actually think your packages installed successfully. R tends to be very verbose and tells you what is happening, even if it is just warnings. Here you have received several warnings, but those are not the same as things not working. I'd say just try to continue with the lessons, which you should be able to do. If not, let me know.

Charles Obiorah

Charles Obiorah

March 3, 2024

Thank you, David. I think I will just go ahead and see what comes up

Charles Obiorah

Charles Obiorah

March 3, 2024

Hello David, I'm glad the packages downloaded after all. I also encountered the same challenges as others, while trying to run tblsummary and make dataReport. i then observed your corrections. It's okay

Shubhra Murarka

Shubhra Murarka

March 1, 2024

I keep getting this error message when i do library(dataReporter): Error: package or namespace load failed for ‘dataReporter’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘robustbase’

& after downloading ggforce, it's telling me there is no package called 'ggforce' when I try to load the library for pointblank.

David Keyes

David Keyes Founder

March 1, 2024

That's very strange. Can you try to run it again and see if that changes anything?

Kim Phillips

Kim Phillips

March 14, 2024

Can you save what comes up in the viewer from the scan_data?

David Keyes

David Keyes Founder

March 14, 2024

Yes, check out this video, which shows how to do this.

Patricia A Spencer

Patricia A Spencer

March 14, 2024

David, when I tried running library (pointblank) I got this message: > library(pointblank) Error: package or namespace load failed for ‘pointblank’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘htmltools’ 0.5.5 is already loaded, but >= 0.5.7 is required

David Keyes

David Keyes Founder

March 14, 2024

Please try running this in the console:

install.packages("htmltools")

Then try running pointblank again. Let me know if that works and, if so, I'll explain what happened.

Patricia A Spencer

Patricia A Spencer

March 15, 2024

Thank you! That worked perfectly.

Jorge Eduardo Baquero

Jorge Eduardo Baquero

March 19, 2024

When installing the pointblank package, the following message does appear:

Warning in install.packages :
  package 'pointblack’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

This is the version of R on Mac:

platform       aarch64-apple-darwin20      
arch           aarch64                     
os             darwin20                    
system         aarch64, darwin20           
status                                     
major          4                           
minor          3.2                         
year           2023                        
month          10                          
day            31                          
svn rev        85441                       
language       R                           
version.string R version 4.3.2 (2023-10-31)
nickname       Eye Holes

What to do in such cases?

David Keyes

David Keyes Founder

March 19, 2024

You've got a couple options:

  1. Update R.
  2. Install the development version of the package from GitHub. I actually have a video showing how to do this.

Let me know if this helps!

Jorge Eduardo Baquero

Jorge Eduardo Baquero

March 20, 2024

It worked with the dev version of the package. Thanks.

David Keyes

David Keyes Founder

March 21, 2024

Also, I wanted to mention that I think you misspelled pointblank, which could also explain why it wasn't working the first time. You wrote pointblack instead of pointblank. Try doing install.packages("pointblank") and that should work (hopefully).

Lilly Kennedy

Lilly Kennedy

March 20, 2024

I am getting errors like: > skim(penguins_data) Error in skim(penguins_data) : could not find function "skim" even though I downloaded the skimr package, why is this?

Libby Heeren

Libby Heeren Coach

March 20, 2024

Hi, Lilly! Did you run library(skimr) before trying to run the skim() function on your data? After you've installed a package, you need to load that package into your R session using a library call. Let me know if that helps!

Lilly Kennedy

Lilly Kennedy

March 20, 2024

Yes I did and it still said it couldn't find that function

Libby Heeren

Libby Heeren Coach

March 20, 2024

Can you run find.package("skimr") for me and tell me what the result is? If the result is a file path, then you do have the package installed successfully, and if the result is Error in find.package("skimr") : there is no package called ‘skimr’ then you'll need to try running install.packages("skimr") again and making sure it successfully installs. We can tackle this in a zoom call!

Lilly Kennedy

Lilly Kennedy

March 20, 2024

This is what I get when I run that: find.package("skimr") [1] "C:/Users/Kenned22/AppData/Local/Programs/R/R-4.3.1/library/skimr"

Libby Heeren

Libby Heeren Coach

March 20, 2024

It looks like it's downloaded successfully! As long as you're running R version 4.3.1, it should be ok. You can quickly check your R version by running R.Version()$version.string but we can get together on zoom and try to figure it out if you can't get it working. I'd restart your R session and retry everything. Go to Session > Restart R. Then, run your code again: load all packages using library calls, import the data set and save it as penguins_data, and then run skim(penguins_data)

Libby Heeren

Libby Heeren Coach

March 20, 2024

It sounds like it's installed. We can get together and work on it on zoom if we need to, but it would be good to restart R and try again. Go to Session > Restart R. Then, run all your code again:

library(tidyverse)
library(skimr)

penguins_data <- read_csv("penguins_data.csv")

skim(penguins_data)

Stephanie Scott

Stephanie Scott

March 21, 2024

Did anyone else get the following? I did not put the hashtag , but that's what came up for me when I ran that code (I have no issue with this, just thought it was interesting).

library(gtsummary) #BlackLivesMatter

David Keyes

David Keyes Founder

March 21, 2024

Yes, developers can put messages that show up when you load a package. This is a good example of that.

Valliappan Muthu

Valliappan Muthu

March 27, 2024

Hi dataReporter generated *.doc file instead of PDF. ANy possible reasons? although it does not matter much, I wanted to know why it was different for me

Valliappan Muthu

Valliappan Muthu

March 27, 2024

hi sorry, Partly got the answers in the comments section - I deleted the previously saved files and tried saving PDF and i got the following messages for the command "makeDataReport (penguins_data, output = "pdf")

Data report generation is finished. Please wait while your output file is being rendered.

Is dataReporter_penguins_data.pdf open on your computer? Please close it as fast as possible to avoid problems!

Error: LaTeX failed to compile dataReporter_penguins_data.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. In addition: Warning message: In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) : '"pdflatex"' not found

Libby Heeren

Libby Heeren Coach

March 28, 2024

Hey, Valli! I think you might be missing an installation of TinyTeX or MikTeX. You can try running install.packages("tinytex") and then tinytex::install_tinytex(). Then, restart your R session (Session > Restart R) and try again. I'm not super familiar with the dataReporter package, unfortunately!

David Keyes

David Keyes Founder

March 28, 2024

I'm having trouble. Why does this code not work?

penguins <- read_csv("penguins.csv")

David Keyes

David Keyes Founder

March 28, 2024

I can't get this working!

ggplot(
  data = penguins_bill_length_by_island,
  aes(
    x = island,
    y = mean_bill_length,
    label = mean_bill_length,
    color = island
  )
) +
  geom_col() +
  geom_text() +
  theme_minimal()