Package or namespace load failed for 'crosstable'

Good day everyone

I successfully installed the package "cross tab" but when I try to load it I get the error below

library('crosstable')
Error: package or namespace load failed for ‘crosstable’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘systemfonts’

I then try to installed system fonts and got this error

install.packages("systemfonts")

There is a binary version available but the source version is later:
binary source needs_compilation
systemfonts 1.0.2 1.0.3 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) crosst Yes
Error in install.packages : Unrecognized response “crosst Yes”

install.packages("systemfonts")

There is a binary version available but the source version is later:
binary source needs_compilation
systemfonts 1.0.2 1.0.3 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘systemfonts’

trying URL 'https://cran.rstudio.com/src/contrib/systemfonts_1.0.3.tar.gz'
Content type 'application/x-gzip' length 81722 bytes (79 KB)

downloaded 79 KB

  • installing source package ‘systemfonts’ ...
    ** package ‘systemfonts’ successfully unpacked and MD5 sums checked
    ** using staged installation
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    --------------------------- [SYSTEMFONTS] -----------------------------
    Configuration failed to find an Objective-C compiler.
    systemfonts require the use of Objective-C code on macOS to access
    the system-native font matching API.
    Please ensure that your build system is setup with an Objective-C
    compiler to install systemfonts on macOS

ERROR: configuration failed for package ‘systemfonts’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/systemfonts’

This is my R.version

R.version
_
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 1.1
year 2021
month 08
day 10
svn rev 80725
language R
version.string R version 4.1.1 (2021-08-10)
nickname Kick Things

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

1 Like

Thanks. That worked ! Much appreciated.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.