0

I'm new in R programming. Want a run little script for TTR package, but getting version error

Here is my code part

options(repos=(CRAN="https://CRAN.R-project.org/package=TTR"))
install.packages("https://CRAN.R-project.org/package=TTR")

and here is error I get

Warning: unable to access index for repository https://CRAN.R-project.org/package=TTR/src/contrib:
cannot open URL 'https://CRAN.R-project.org/package=TTR/src/contrib/PACKAGES'

Warning message: package 'https://CRAN.R-project.org/package=TTR' is not available (for R version 3.4.4) 

Error in library(TTR) : there is no package called 'TTR'

but when I run TTR library from https://rdrr.io/snippets/ , it works well, and R version in the link is 3.4.4

How can I solve this problem?

EDIT: I see this question How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?, but can not find my solution

gjivanya
  • 519
  • 2
  • 6
  • 19

1 Answers1

0

I tried it with your command, and i get the same error. But using the standard way with install.packages does the job.

You can install the package with:

install.packages('TTR', dependencies=TRUE, repos='http://cran.rstudio.com/')
mischva11
  • 2,811
  • 3
  • 18
  • 34