Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optunity R Windows #72

Closed
hseelawi opened this issue Jun 7, 2016 · 3 comments
Closed

Optunity R Windows #72

hseelawi opened this issue Jun 7, 2016 · 3 comments

Comments

@hseelawi
Copy link

hseelawi commented Jun 7, 2016

I have been trying to install optunity for R on my Windows 10 pc, but am not sure I understand the instruction found in the library documentation. To be more specific, I tried typing the two command lines below in git bash and the command prompt, but they both return an error message that "R" is not a recognizable command.

R CMD build R/
R CMD INSTALL optunity_.tar.gz

Would you kindly help.

@Qunal
Copy link

Qunal commented Sep 17, 2016

I just installed with R. This is a path and potentially a binary problem. Rcmd.exe is in C:\Program Files\R\version\bin. Set that in your system path

On Windows to build R packages you need Rtools and relevant compiler. Google and install Rtools first

@mlnjsh
Copy link

mlnjsh commented Mar 20, 2019

@ Qunal how did you install it for R
pls guide me step by step

@webzest
Copy link

webzest commented Jul 3, 2020

Here is what you can try: Make sure you have RTools installed on your Windows PC

  1. download the code as a zip file from here: https://github.com/claesenm/optunity.git
  2. unzip it into a local directory: C:\optunity
  3. make sure R is installed and can be reached from a command line.
  4. Open a windows CMD window with Administrator rights: C:\Windows\System32>cd\
  5. Navigate to the optunity Wrappers directory: C:>cd optunity\wrappers
  6. Inside the wrappers directory, check that R is accessible: C:\optunity\wrappers>R
    if you get an error, then you are not ready and you need to add R to your PATH
  7. Inside the wrappers directory: C:\optunity\wrappers>R CMD build R/
  8. A compressed file should be created: optunity_1.0.tar.gz
  9. Open R and install the following libraries: install.packages(c("rjson", "ROCR", "enrichvs", "plyr"))
    10 . Then, install the gz optunity file file with the Tools installer and point it to the gz file.

I was able to get the file to install, but was not able to run Code successfully with optunity. For example, this piece of code from the help file failed on my PC, after having a successful installation:

`

library(optunity)
f <- function(x,y) -xx - 0.5y*y
opt <- particle_swarm(f, x=c(-5, 5), y=c(-5, 5) )
Error in if (is.na(port) || port == 0) { :
missing value where TRUE/FALSE needed

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants