#### noetsi

##### No cake for spunky
Problem Installing R

Not sure if I did the installation wrong or the library loading.

In installed several new programs used for time series in R. I am using the window version and R 2.1.5. There is a menu that goes Packages -> Install Packages

Initially all appeared to go well. I got the following message.

package ‘TTR’ successfully unpacked and MD5 sums checked

Other related programs (e.g., zoo" were added as well.

then I did this:

library("TTR")

and got this:

Error in library("TTR") : there is no package called ‘TTR’

I tried leaving R and comming back, but got the same message.

Anyone know what I am doing wrong?

#### trinker

##### ggplot2orBust
If you type this into the command line do you see TTR in the list?

Code:
list.files(.libPaths())
Also I'd check:

Code:
.libPaths()
and see where your library is at. I used your exact commands and it worked fine so that tells me it has something to do with your library location.

PS the quotation marks around TTR are unnecessary in the library() function. Over the course of the rest of your career I may have gained you 2.7534 days of saved time from not typing the extra quotes. Now go tell your boss you've saved enough time to take a 3 day vacation.

#### noetsi

##### No cake for spunky
Neither forcast nor TTR shows up. But as I noted before I am getting a message that it installed correctly. And a program I added yesterday is showing up....

Any suggestions on what I am doing wrong in the installation?

We moved our drivers after I installed R, but R itself works and I installed these new programs after the drivers moved.

How do I change my library location?

This is where my library is

"C:/Program Files/R/R-2.15.0/library"

Which moved the other day. How do I respecify the library?

The book I have said to use quotation marks

#### Dason

Can you try reinstalling?

Code:
install.packages("TTR")
library(TTR)

#### noetsi

##### No cake for spunky
Sure. But I did not do it that way the other day. The R has an automated feature that adds packages. The concern I have is that the packages I have have other associated packages which the automatic feature adds. I don't know if the install command does this.

#### Dason

It does. The menu you used in RGui literally just sends the command:
Code:
install.packages()
The dependency resolution is taken care of for you if you're installing from CRAN (which you are).

#### noetsi

##### No cake for spunky
When I try that I get:

Warning in install.packages("TTR") :
'lib = "C:/Program Files/R/R-2.15.0/library"' is not writable
Error in install.packages("TTR") : unable to install packages

I get a similar error with the automatic feature.

It is possible that our C drive moved since I installed R yesterday - our drivers moved although this was not supposed to have effected the drive R is at. Also the basic functions in R(like addition) work.

Do I need to uninstall and then reinstall R?

If it matters I saved my workspace the last time I ran R. Not sure if this effects anything.

#### Dason

There are a few options here. The error you're getting is because R is installed into Program Files and to write there you need administrative access.

The options are to create a local directory somewhere that you have write access to and then install your packages there and make sure that that location is in your .libPaths. This could easily be modified using a .Rprofile file to make sure .libPaths gets set correctly. Although none of this is particularly hard to do it does take some know-how.

Another possibility is to reinstall R into a location that you have read/write access. This might be the easier route if you have the ability to install software.

#### noetsi

##### No cake for spunky
It was written to someplace I have authority, it actually ran fine (including import) yesterday.

I think I will just reinstall it.

#### trinker

##### ggplot2orBust
It's strange that R tried to write your library there. By default this is the path to my library:

Code:
> .libPaths()[1]
[1] "C:/Users/Rinker/R/win-library/2.15"
I would try the uninstall/re-install as Dason suggested.

I hate when new R users run into snags like this. I wish everything would be smooth (as is usually the case). I promise it'll be worth it Noetsi.

PS I wouldn't save work space. I save scripts and never save work spaces (others may disagree) but saving work spaces may lead to problems. A script can be saved as a txt file for easy editing and storage.

#### bryangoodrich

##### Probably A Mammal
It's good for you to reinstall it to a directory that doesn't have spaces (like "Program Files"), because some R problems can arise from that. Like Trinker has his, it isn't a bad idea to put everything in your user directory C:\Users\YourName\R but since I'm the only user, I just drop everything at C:\R for simplicity. The main thing does appear to be that you install it somewhere you have control of, which your home directory should have.

#### Dason

Yeah I have R installed to C:\R. Previously it installed to C:\Program Files\R and the libraries went to C:\Users\dasonk\R\win-library\R-2.xx

I much prefer it being at C:\R

#### noetsi

##### No cake for spunky
I am more stuborn than that trinker, I won't give up over such problems

The place I put it is actually the default when you run the installation at the site I went to. Which I think is the main site. I followed the instructions to install from my R for time series book...

My personal drive is called P. If I wanted to set up R to go there would I create a folder there called R then do (during the installation) "P:/R"

#### Dason

PS I wouldn't save work space. I save scripts and never save work spaces (others may disagree) but saving work spaces may lead to problems. A script can be saved as a txt file for easy editing and storage.
I typically agree with you. I almost always work from a script. But when I do simulations that take a while (say... 24 hours) I typically save the entire workspace at the end of the script just in case the rest of the output somehow got clobbered.

The place I put it is actually the default when you run the installation at the site I went to.
I don't know why it defaults to that. It works just fine if you're an administrator but it's supposed to set up a local user location to install packages for you if you don't have write access to the global library. I wonder if there is something for TTR currently in the global library so when you try to reinstall it tries to install there instead of a local user location.

#### noetsi

##### No cake for spunky
I reinstalled R today (after eliminating the previous one). I told it the destination location was a folder called R in a drive P I have confirmed I have write access to. I started to install the folders then at the end gave me this message.

Error creating Registration Key
H Key_LOCAL_MACHINE
SOFTWARE\R-Core

RecreateKEYEXFAILEd, code 5
Access is denied.

It looks like the folders were actually created but R did not show up on my system

#### trinker

##### ggplot2orBust
You may need to delete some rogue folders. I had something similar happen to me a while back. If you're a Windows 7 user (pretty sure you are) type TTR into the search thingy windows has (click on the colorful windows logo in the bottom left side). If TTR comes up right click on it and then "open folder location". Try deleting the actual TTR directory and re-installing TTR in the manor Dason suggested.

This has worked for me in the past.

#### noetsi

##### No cake for spunky
I am actually trying to get R itself on the system. I was reinstalling it.

#### noetsi

##### No cake for spunky
I think it finally works. But I wanted someone here to let me know if this is what you should get when you load a library

‘tseries’ version: 0.10-28

‘tseries’ is a package for time series analysis and computational
finance.

See ‘library(help="tseries")’ for details.