[TxMt] problem with R interaction [was math bundle feature request]

Peter Cowan cowan.pd at gmail.com
Fri Dec 8 20:08:19 UTC 2006


If I'm not mistaken to use commands for the console grammer the line
needs a leading greater than symbol and space "> ".  Doing so gives me
the correct answer, the command also inserts this on the next line
which is why you see the trailing greater than symbol.

e.g:
> 100^2
[1] 10000
> 1/1e-1
[1] 10
>

See also the help file in the R bundle.

Peter

On 12/8/06, janssen at ccr.jussieu.fr <janssen at ccr.jussieu.fr> wrote:
> Thanks this is doing it -
> Actually I only need to deal with floats using scientific notation and powers,
> logs, etc., which is all available in ruby (but not quite in the math bundle,
> where I would have expected it). Are trigonometric functions available in Ruby
> too? cos(0.5) is not working for me using Ruby.
>
> How would I go to make a decent shortcut for the Execute Line as Ruby command?
> ^-Shft-E is already used in the Latex bundle - I can certainly use the bundle
> editor to select another short cut for it, but is this recommended or
> are there
> better solutions.
>
> > You don't need to know anything about Ruby, in fact the command I
> > mentioned in the previous email computes 1/1e-1 just fine. All you
> > have to do is look up the names of the standard commands in that ruby
> >  help page I linked to, so that you know what to call, i.e. that
> > log()  is for logarithms log10() for base 10 logarithms etc. If you
> > give us  a list of the kind of simple math you want to do, and how
> > ideally you  would like to type them in, we can offer a better
> > suggestion I think  (though I am fairly certain that the ruby command
> > as it stands will  already cover most if not all of them).
> >
> >> JJ
> >
> And yes, Haris, 100^2 <> 0. You actually pointed it out - it is not the
> different functions that cause the problem. There appear many things to go on
> at the same time, and shame on me, I was not careful enough when reporting to
> the list. Here is a set of lines that were selected in Textmate and then
> evaluated through R via the Console command:
>
> 100^2
> [1] 0
> >
>
> 100^2
> [1] 10000
> >
>
> 1/e-1
> Fehler: syntax error
> >
>
> 1/1e-1
> Fehler: syntax error
> >
> 1/1e-1
> [1] 10
> >
>
> 1/e-1
> Fehler: objekt "e" nicht gefunden
> >
>
> I made a mistake by typing e-1 instead of 1e-1. This way R could not interpret
> what I meant. But in addition, the selected region gets somehow corrupted. It
> seems that the first character is suppressed when transferred to R. Leading to
> 00 in one case which gives the correct result 0^2=0. When there is an empty
> space in front of the number it gets transferred completely and 100^2=10000.
> THis must lead to an error message in case of a 1e-1 at the beginning of a
> line, because e-1 cannot be interpreted ...
>
> May be this can be confirmed by others, or is it me again?
>
> JJ
> > Haris
> >
> >
> >
> > ______________________________________________________________________
> > For new threads USE THIS: textmate at lists.macromates.com
> > (threading gets destroyed and the universe will collapse if you don't)
> > http://lists.macromates.com/mailman/listinfo/textmate
> >
>
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>



More information about the textmate mailing list