loelschlaeger / ao

Alternating optimization in R
http://loelschlaeger.de/ao/
GNU General Public License v3.0
2 stars 2 forks source link

bug #10

Closed sepi1881 closed 2 months ago

sepi1881 commented 2 months ago

after I install.packages("ao") in R console I type

ao(f = rosenbrock, initial = c(2, 2))

but there is this output:

Error in ao(f = rosenbrock, initial = c(2, 2)) : 
  could not find function "ao"
loelschlaeger commented 2 months ago

you need to call library(ao) before using the package

sepi1881 commented 2 months ago

I choose ao package from Load Packages but there is an error ----> Error: package or namespace load failed for ‘ao’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘magick’

loelschlaeger commented 2 months ago

This error message tells you that you need to install the magick package. Please restart your R session and try the following to install all required dependencies:

install.packages("ao", dependencies = TRUE)
library("ao")
sepi1881 commented 2 months ago

you are right my problem is in magick package installation where I tried to install it there is an error : trying URL 'https://cran.um.ac.ir/bin/windows/contrib/4.4/magick_2.8.4.zip' Content type 'application/zip' length 24799841 bytes (23.7 MB) downloaded 18.1 MB

Error in download.file(url, destfile, method, mode = "wb", ...) : download from 'https://cran.um.ac.ir/bin/windows/contrib/4.4/magick_2.8.4.zip' failed In addition: Warning messages: 1: In download.file(url, destfile, method, mode = "wb", ...) : downloaded length 19007964 != reported length 24799841 2: In download.file(url, destfile, method, mode = "wb", ...) : URL 'https://cran.um.ac.ir/bin/windows/contrib/4.4/magick_2.8.4.zip': Timeout of 60 seconds was reached Warning in download.packages(pkgs, destdir = tmpd, available = available, : download of package ‘magick’ failed

loelschlaeger commented 2 months ago

Hm, the following works for me:

install.packages("magick", repos = "http://cran.us.r-project.org", dependencies = TRUE)

Does it also work for you?

sepi1881 commented 2 months ago

thanks a lot it works