Unable to access index for repository

Hi!
I am VERY new to coding and need to install the r package "polr." I have been using r studio and an r markdown file. Every time try to install install.packages('polr',repos='R/polr.R')

I get these error messages

Warning in install.packages :
unable to access index for repository R/polr.R/src/contrib:
cannot open URL 'R/polr.R/src/contrib/PACKAGES'
Warning in install.packages :
package ‘polr’ is not available (for R version 3.5.3)
Warning in install.packages :
unable to access index for repository R/polr.R/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'R/polr.R/bin/macosx/el-capitan/contrib/3.5/PACKAGES'

Please send help.

There is no package called polr on CRAN, 'R/polr.R' is not a valid repository address or even a valid file extension for a package, Could you give us a little more of background information? From what source are you trying to install that package? Maybe you are confusing this with the polr() function from the MASS package?

1 Like

Yes, I think I was confusing the polr () function from the MASS package. Yet still, I tried using the polr() function in my r markdown file and i get an error message that says
"Error in polr(Algae.on.Carapace ~ Season, data = datatrain, Hess = TRUE) :
could not find function "polr"

Like i said im really new to this. I do know that I have the MASS package

Even if you have MASS package installed you still have to load it on each new R session if you want to use it, try running library(MASS) before calling the function.

2 Likes

This totally helped! I checked the small box next to MASS to load it and that worked great! Thank you so much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.