.trPaths possible solution

280 views
Skip to first unread message

Ari

unread,
Jun 11, 2016, 12:32:53 PM6/11/16
to Tinn-R Editor
Although TInnR is supposed to set .trPaths automatically, this hasn't worked for me for a while (Windows 7).
After installing the new "prerelease" (4.00.16.00) it worked at first, but then stopped working, so I investigated a bit and found the following:

The file <appdata>\Local\Temp\Tinn-R\sgInfo.R, which is generated automatically by TinnR, was silently failing to find 'TinnRcom' (find.package('TinnRcom')).

I manually installed TinnRcom using:
   install.packages("C:/Tinn-R/package/TinnRcom_1.0.18.zip", repos=NULL, contriburl=NULL)
after which everything appears to be working fine again.

TinnRcom was installed for a different version of R on my system, so I suspect the problem may be related to upgrading R after installation? or switching between different versions of R?

Anyway, it seems that a simple solution could be to add an if clause in sgInfo.R
trc_path <- try(find.package('TinnRcom'),
                silent=TRUE)
}
if(!file.exists(trc_path)) {
   install.packages("<Tinn-R path>/package/TinnRcom_1.0.18.zip", repos=NULL, contriburl=NULL);
   trc_path <- try(find.package('TinnRcom'),
                silent=TRUE)
}

if(!file.exists(trc_path))
{
 etc.  or even better report it to the console, not just to the txt file.
}

What do you think?

Jose Claudio Faria

unread,
Jul 3, 2016, 6:50:38 PM7/3/16
to Ari, Tinn-R Editor
Dear Ari,

First, sorry for the delay and thanks for the suggestion.

We believe that these problems were definitely fixed in the pre-release version Pre-release (01/07/2016): Tinn-R_04.02.04.00_setup.exe.

Please, could you to check?

Best,
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
Jose Claudio Faria
Estatistica
UESC/DCET/Brasil
joseclaudio.faria at gmail.com
Telefones:
55(73)3680.5545 - UESC
55(73)99966.9100 - VIVO
55(73)99100.7351 - TIM
55(73)98817.6159 - OI
55(73)98129.9942 - CLARO
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\

--
You received this message because you are subscribed to the Google Groups "Tinn-R Editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinn-r+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kornfeld, Ari

unread,
Jul 4, 2016, 7:26:56 PM7/4/16
to Jose Claudio Faria, Tinn-R Editor
Dear Jose,

  Thank you for the update but it doesn't work. There are at least two problems:

(1)  First I started the new TinnR v04.02.04.00 as administrator and then started RGUI (R3.2.3), it went into an "infinite" loop of installing the new TinnR library which finally ended with:
  Error in unloadNamespace(package) :
    namespace ‘formatR’ is imported by ‘TinnRcom’ so cannot be unloaded
  In addition: Warning messages:
  1: package ‘TinnRcom’ was built under R version 3.2.5
  2: package ‘svSocket’ was built under R version 3.3.0
  3: package ‘formatR’ was built under R version 3.3.0

(Possibly because I forced an "open" dialog in an attempt to stop it and to see what's in the sgInfo.R file.)  Starting up a second time (not as administrator) and it was fine. 

  So either there is an infinite loop or you are trying installing TinnR in every version of R I have. Either way is incorrect behavior!  It should only install in the current version (i.e. the version being used with TinnR).

(2)  I then upgraded to the latest version of R (intentionally done *after* installing TinnR to reproduce my reported error condition)
  Upon running the new pre-release of TnnR (both as normal user and administrator) I got the same error as in my original report: (Start RGUI, click on "Source File")

> source(.trPaths[4], echo=TRUE, max.deparse.length=150)
Error in source(.trPaths[4], echo = TRUE, max.deparse.length = 150) :
  object '.trPaths' not found

Not surprisingly, <Local>\temp\Tinn-R\Rinfo.txt says: "Not installed!   x.x-x   :( "

(3) Looking in C:/Users/Ari/AppData/Local/Temp/Tinn-R/sgInfo.R' I see it has not changed, so presumably you changed something else instead.  Perhaps changing the sgInfo.R as I had suggested earlier would be more robust?
  Also, it would be very helpful to report at l east the version to the console rather than in a "virtually-inaccessible" file!

  Regards,
-ari
P.S.  Thank you for putting my other request on you TODO list!



Jose Claudio Faria

unread,
Jul 5, 2016, 6:57:05 AM7/5/16
to Kornfeld, Ari, Tinn-R Editor
On Mon, Jul 4, 2016 at 8:26 PM, Kornfeld, Ari <ak...@carnegiescience.edu> wrote:
Dear Jose,

  Thank you for the update but it doesn't work. There are at least two problems:

(1)  First I started the new TinnR v04.02.04.00 as administrator and then started RGUI (R3.2.3), it went into an "infinite" loop of installing the new TinnR library which finally ended with:
  Error in unloadNamespace(package) :
    namespace ‘formatR’ is imported by ‘TinnRcom’ so cannot be unloaded
  In addition: Warning messages:
  1: package ‘TinnRcom’ was built under R version 3.2.5
  2: package ‘svSocket’ was built under R version 3.3.0
  3: package ‘formatR’ was built under R version 3.3.0

(Possibly because I forced an "open" dialog in an attempt to stop it and to see what's in the sgInfo.R file.)  Starting up a second time (not as administrator) and it was fine. 

Ari,

Thank you for the feedback, tests on different computers and user profiles are important for the evolution of the project.Thanks for the details.

Strange, do you have something related in the file Rprofile.site? 
Please, let me know the content of you file.
This file will be in the folder 'etc' where you R is instaled, in my case: C:\Program Files\R\R-3.3.0patched\etc\Rprofile.site

I woul like to know also the result of the .libPaths() of ou computer.
In my case:

> .libPaths()
[1] "C:/Users/jcfaria/Documents/R/win-library/3.3"
[2] "C:/Program Files/R/R-3.3.0patched/library"   

 So either there is an infinite loop or you are trying installing TinnR in every version of R I have. Either way is incorrect behavior!  It should only install in the current version (i.e. the version being used with TinnR).

The algorithm tries to install the necessary packages only in the version you are using with Tinn-R!
A doubt: Did you start the Rgui.exe within the Tinn-R or externally?
 
(2)  I then upgraded to the latest version of R (intentionally done *after* installing TinnR to reproduce my reported error condition)
  Upon running the new pre-release of TnnR (both as normal user and administrator) I got the same error as in my original report: (Start RGUI, click on "Source File")

> source(.trPaths[4], echo=TRUE, max.deparse.length=150)
Error in source(.trPaths[4], echo = TRUE, max.deparse.length = 150) :
  object '.trPaths' not found

TinnRcom - and its dependencies - was not installed in this new version.
 
Not surprisingly, <Local>\temp\Tinn-R\Rinfo.txt says: "Not installed!   x.x-x   :( "

(3) Looking in C:/Users/Ari/AppData/Local/Temp/Tinn-R/sgInfo.R' I see it has not changed, so presumably you changed something else instead.  Perhaps changing the sgInfo.R as I had suggested earlier would be more robust?

I am aware of your suggestion in this direction to make the installation of the packages more robust necessary, however, I opted for a parallel direction.
 
  Also, it would be very helpful to report at l east the version to the console rather than in a "virtually-inaccessible" file!

Sorry, I did not understand this paragraph (language barrier). COuld you could say in other words?
 
  Regards,
-ari
P.S.  Thank you for putting my other request on you TODO list!

The addition of the "Note" identifier for highlighters of R family (Note.png) has been made, you will see in the next pre-release.
Note.png

Kornfeld, Ari

unread,
Jul 5, 2016, 8:46:03 AM7/5/16
to Jose Claudio Faria, Tinn-R Editor
Jose

1. Rprofile.site:
  It looks like the standard file create by the install program.The only line that is not a comment is:

  options(help_type="html")

2. .libPaths():
  "C:/Users/Ari/Documents/R/win-library/3.3" "C:/Program Files/R/R-3.3.1/library"

3. "Did you start the Rgui.exe within the Tinn-R or externally?"
  No.  In all cases I had Tinn-R start the Rgui.

4. "TinnRcom - and its dependencies - was not installed in this new version"
  Correct. After installing it manually everything worked (but this was in my original bug report so I didn't mention it again.)

5.   "
  Also, it would be very helpful to report at l east the version to the console rather than in a "virtually-inaccessible" file!

Sorry, I did not understand this paragraph (language barrier). Could you could say in other words?"

 No problem. Hopefully the following is clearer:
  In sgInfo.R, you use sink(tr_info) to write version information to the file:
   C:/Users/Ari/AppData/Local/Temp/Tinn-R/Rinfo.txt
 Most people would never know that this file is created. It seemed to me that it would be helpful to the user to see some of the output printed to the R console -- particularly a message such as "using TinRcomm v1.0.19" (or that it was not found if  you choose not to install when it's not found).

6. Does one have to run as administrator the first time?  If not, perhaps that was the problem or difference between our experiences?

7. Unreleated:  TinnR still freezes for up-to several seconds after showing:
    source('C:/Users/Ari/AppData/Local/Temp/Tinn-R/sgInfo.R')
and before showing:
    startSocketServer(port=8889)

Thus it looks like R and TinnR are available, but they are not. If this pause can't be resolved, it would be helpful at least to give a visual indication (either change the cursor or show a dialog or print a message in R console). Currently, the cursor only changes near the end of the "frozen" period.

Hopefully this helps!

Thank you, as always, for maintaining this wonderful program!
-ari

marQIsoft

unread,
Aug 12, 2016, 11:27:16 AM8/12/16
to Tinn-R Editor, joseclau...@gmail.com
Hi Jose and Ari,

Many good points were raised by Ari. I'd simply add an observation of mine, that I made a couple of days ago, after updating Tinn-R.

[Main topics of my comments: Package installation; Confusion between library paths]

My computer has admin rights, so R is allowed to install packages into Program Files if I tell "him" to do so. And that's usually what I want, because I prefer to keep My Documents folder free from non-"document" files... mostly to make backups of this folder lighter. Ok, so... Just after Tinn-R program was updated, when I started it, I had this issue of "infinite loop of trying to install TinnRcom pkg". It seemed Tinn-R was not satisfied by any install iteration, telling me that the "installed" version was not up-to-date. And when I took a look at the contents of R library folder, I saw that it had "TinnRcom", "formatR", "svSocket" and "svMisc" folders. That would be okay... IF Tinn-R did not wish to install its required packages into another path, of the form "C:/Users/{USER}/Documents/R/win-library/3.3". Hence, my hypothesis is that this "infinite" loop occurs when there are duplicated versions of those required-by-TinnR packages, due to the fact than there are two possible library paths.

By the way, I don't know if other Tinn-R users wish the same, but I would like to be able to force Tinn-R to use one library path for ALL package installs, including the ones that "he" tries to install/update right after Tinn-R program install/update (i.e. "TinnRcom", "formatR", "svSocket" and "svMisc"). I've noticed that even if I change the "Default to install and update packages" to ".libPaths()[2L]" for targeting Program Files/... path, it ignores this when trying to install TinnRcom et al. Because of this, I cannot prevent Tinn-R from creating these 4 folders in My Documents, which I dislike.

But maybe I lack a piece of information? Is there a way to permanently modify these path strings, in some INI text file for example? That could be sufficient.
Besides, would it be possible to tell R to use the same install path target as Tinn-R, at least when R (R console) is launched by Tinn-R?
  (because at present, if I use the Install button within Tinn-R, it takes my ".libPaths()[2L]" custom setting into account, BUT if I install a package directly from R console menus, it ignores my custom setting and therefore uses .libPaths()[1L].

And very last suggestion: I know that I should send my request directly to the R development team, but since you're closer to R IDE development than I, I prefer to share my idea with you, Jose. The window that pops up for installing packages in R is very simple, and that's ok. But we all know that there are thousands of available packages, so... Why isn't there a way to find the right package faster? I dislike having to use my mouse to scroll up and down 'til I locate the right starting letter, then the full name of the package I want. In almost every long list similar to this one, it is possible to type the first couple of letters of the searched name. If you find this is a good idea, Jose, would you accept to send this R-GUI simple feature request to the appropriate branch of R development team? That would be a subtle but nonetheless very appreciated improvement of that "Packages " window.

That completes what I wanted to add to Ari's post.
Thanks for reading!
And nice weekend to you.


Marc.

Jose Claudio Faria

unread,
Sep 18, 2016, 7:52:39 AM9/18/16
to marQIsoft, Tinn-R Editor
Hello,

Apologies for the delay, I'm reviewing (the oldest to the newest) all
the suggestions made to Tinn-R project.

We believe that the problems pointed out related to the automatic
installation of the necessary packages (TinnRcom, formatR, svMisc and
svSocket) were definitely fixed in version 4.02.13.00 to be released.
If the user want to change the default procedure (mainly the place),
it can be made editing the R script "utils/info.R" and
"utils/install.R".

Marc, I agree that the standard graphical interface for selection of
packages is R very poor. It would be nice if the Core Team improve
usability, allowing the selection as you type something.

We will try to build a graphical interface for manager packages (xml
based) in Tinn-R project to workaorund: Tools/R/Packages:
Available|Installed.

All the best,

Ari

unread,
Oct 6, 2016, 4:52:09 AM10/6/16
to Tinn-R Editor, marc.lau...@gmail.com
Thank you Jose!!!  Version 4.02.17.00 looks like it works properly with regard to this issue and,
even more importantly to me, you brought back the "#!" highlighting! Thank you so much!

Best regards,
-ari
Reply all
Reply to author
Forward
0 new messages