New to R. Getting an error trying to run load packages

I'm a complete newbie, going through a course on LinkedIn Learning. I'm at the point where the code in the exercises is

if (!require("pacman")) install.packages("pacman")

The IF statement doesn't seem to do anything, so I just run


Everything seems to work fine. The next line of code in the exercise is

pacman::p_load(pacman, party, rio, tidyverse)

There is a dependency of data.table.

There is a binary version available but the source version is later: binary source needs_complication
data.table 1.12.8 1.13.0 TRUE
Do you want to install from sources the package which needs complication? (Yes/no/cancel)

I enter "yes". A flutter of activity then I get this

Error: package or namespace load failed for ‘data.table’ in library.dynam(lib, package, package.lib):
shared object ‘’ not found
Error: loading failed
Execution halted
ERROR: loading failed
removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/data.table’

The downloaded source packages are in

rio installed
Warning messages:
1: In utils::install.packages(package, ...) :
installation of package ‘data.table’ had non-zero exit status
2: In pacman::p_load(pacman, party, rio, tidyverse) :
Failed to install/load:

I'm not sure what to do to resolve this. Can someone help a rookie?

Hi, you're on macOS. Just say say no to the question about installing from source. It's possible, but definitely not plug and play.

1 Like

Thank you for your help. The fact that I didn't even try that shows how unsure I am in this new environment.

1 Like

We all start there. It's sort of like going to a new school as a kid. Takes a while to learn all the stuff everyone takes for granted.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.