I can install both Hmisc and png but when I try library(Hmisc) or library(png) I get this error:
Error: package or namespace load failed for ‘png’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/png/libs/png.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/png/libs/png.so, 6): Symbol not found: _inflateValidate
Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/png/libs/png.so (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libz.1.dylib
in /Library/Frameworks/R.framework/Versions/4.1/Resources/library/png/libs/png.so