# Unable to load "sf" package

**URL:** https://renku.discourse.group/t/unable-to-load-sf-package/1006
**Category:** RenkuLab
**Created:** [29 February 2024 09:29 UTC](https://renku.discourse.group/t/unable-to-load-sf-package/1006 "2024-02-29T09:29:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ian-bonhote](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/ian-bonhote/32/789_2.png) [@ian-bonhote](https://renku.discourse.group/u/ian-bonhote)
#### Post date: [29 February 2024 09:29 UTC](https://renku.discourse.group/t/unable-to-load-sf-package/1006/1 "2024-02-29T09:29:59Z")

</div>

Hi,

I am rather new to the Renku platform, and I am having trouble using the R package “sf”, which I need to plot some maps.

I created my project using the R template, and I am using the RStudio environment. Installing the package with

```auto
install.packages('sf')

```

works fine, but when I load the package I get the following error:

```auto
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/site-library/units/libs/units.so':
  libudunits2.so.0: cannot open shared object file: No such file or directory

```

What should I do to fix this? Thanks in advance.

---

<div class="post-metadata">

### Author: ![ian-bonhote](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/ian-bonhote/32/789_2.png) [@ian-bonhote](https://renku.discourse.group/u/ian-bonhote)
#### Post date: [17 March 2024 19:13 UTC](https://renku.discourse.group/t/unable-to-load-sf-package/1006/2 "2024-03-17T19:13:23Z")

</div>

Found out how to solve the problem: install the required dependencies, as described in [https://github.com/r-spatial/sf](https://github.com/r-spatial/sf). I added

```auto
apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev

```

at the appropriate location in the Dockerfile.

---

<div class="post-metadata">

### Author: ![elisabetc](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/elisabetc/32/811_2.png) [@elisabetc](https://renku.discourse.group/u/elisabetc)
#### Post date: [18 March 2024 09:05 UTC](https://renku.discourse.group/t/unable-to-load-sf-package/1006/3 "2024-03-18T09:05:36Z")

</div>

Thank you so much @ian-bonhote for sharing your issue and the solution you found! I am sure it will be useful for other users!
