Error during packaging installation

Hello!

I am not very familiar with R and I am using a code to estimate the environmental footprint of a pharmaceutical. I tried to follow the steps indicate on this website (Fine Chem – Safety and Environmental Technology Group | ETH Zurich). However, I get an error each time. Thanks

setwd("~/R/win-library/4.1")
install.packages("nnet")
Installing package into ‘C:/Users/mcoorema/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/nnet_7.3-17.zip'
Content type 'application/zip' length 137610 bytes (134 KB)
downloaded 134 KB

package ‘nnet’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\mcoorema\AppData\Local\Temp\Rtmps9g5W7\downloaded_packages

load("~/R/win-library/4.1/Finechem/Finechem_models.RData")
source ("Finechem\Finechem_run.R")
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "nnet"

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: 2021.09.2 Build 382
  • OS Version:
  • R Version: x64 4.1.2

Hi, the installation of the package seems OK. Could it be that you forgot to load the package in your environment by putting library(nnet) before source(...)?

JW

1 Like

This topic was automatically closed 21 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.