<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Dec 19, 2006, at 4:56 AM, Hans-Joerg Bibiko wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Nevertheless I have some humble suggestions to improve it:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">1)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Now this command executes the apropos function within a new fresh R session. This means that it doesn't know which libraries I'm currently using and it doesn't know which functions I defined within my R session. To use 'Insert Command Template' also for this you should load the function 'getSig.r' in my current session (renamed in '.getSig' ) and executes this within my session to get these signatures too.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">By doing so you would increase the speed of it enormously and you can insert signatures for user-defined functions and functions coming from loaded libraries.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">The disadvantage of it would be that you have such queries in your current session; ok you don't see them in the TM R console window, but if you save it workspace you would have these.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">To avoid this you could think about to write the answer of the query into a file and load it in TM.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Or, if you don't interested in the user-defined functions you could start a new R session which loads all libraries which are loaded in my current session.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">(I don't know whether this would also work for user-defined fucntions?)</FONT></P></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>That only works if you have a "current session". I assume you use the hackery that uses R.app to execute stuff? I, for example, don't like that and so I don't use it at all, so I wouldn't have the concept of a "current session".</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'd like to let it load libraries which are loaded in your current session, as well as detect function definitions and provide those as well. I just don't know how much work it takes to do that safely (safely meaning you don't want any side effects) and cleanly.</DIV><BR><BLOCKQUOTE type="cite"> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">2)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">If you use the approach in 1) then you can do more elaborated things with it because of the speed.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Examples:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-If I look for for a keyword it will insert the signature like the old version. If there is nothing found it will look for functions which begins with the keyword like the old version.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-If I type e.g. 'data.' it lists all methods for 'data.' like data.class, data.frame etc. but not 'dataentry'</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-If I type e.g. '.difftime' you get all functions where '.difftime' is specified like mean.difftime, print.difftime. To insert the signature you have to select the keyword in beforehand otherwise it shows a tooltip.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-If I have no idea about the complete name of a function you can type e.g. '.load.'. This would look for '*load*' as regexp. Furthermore sometimes I cannot remember whether the a function is called 'shownames' or 'showNames', so you can write '.names.' and it looks for '*names*|*Names*'.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I would use periods for '.foo.' for indicating this because it will be caught be Ruby's getword function.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Of course you can do more things:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">-You could catch the 'apropos()' function and run it in TM and print the result as pop down menu</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">and<SPAN class="Apple-converted-space"> </SPAN>and<SPAN class="Apple-converted-space"> </SPAN>and</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">What do you think about it?</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">To change to code would be relatively easy.</FONT></P> </BLOCKQUOTE><BR></DIV><DIV>I'm not really sure I understand the second point here.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:kevin@sb.org">kevin@sb.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>