[TxMt] Re: R-package - strange parsing errors
Martin Batholdy
batholdy at googlemail.com
Mon Oct 17 16:07:29 UTC 2011
Hi Hans,
sorry for the delayed response.
Ok … I am working on 10.7.2 (so I already upgraded to lion – kind of regret it …)
R version 2.13.1 (2011-07-08).
So this is what I found in the first lines of the r_out-file:
WARNING: unknown option '--TMRdaemon'
ARGUMENT '2' __ignored__
[1] ".RProfile im User Order laedt:"
[1] "Programmierung/R Arbeitsverzeichnis/eigene Funktionen/own.functions.R"
> source("/Users/bath/Library/Application Support/Rdaemon/daemon/start.r")
> sink('/Users/bath/Library/Application Support/Rdaemon/r_tmp');cat(geterrmessage());sink(file=NULL)
(the first two lines are just from a print-expression of the .Rprofile file that is loaded at the beginning of an R-session)
then my script seems to work fine till this point (line 177 in the original script) :
> x <- c(14, 17, 20, 23)
> for(i in 1:length(x)) { prfor(i in 1:length(x)) { prfor(i in 1:length(x)) { prfor(i in 1:length(x)) { prfor(i i_reduced)
Error: unexpected 'in' in "for(i in 1:length(x)) { prfor(i in"
> full_matrix <- cbind(full_matrix, reduced_datfull_matrix <- cbind(full_matrix, reduced_datfull_matrix <- cbind(fse { final_matrix <- rbind(final_matrix, full_matrix) }
Error: unexpected '{' in "full_matrix <- cbind(full_matrix, reduced_datfull_matrix <- cbind(full_matrix, reduced_datfull_matrix <- cbind(fse {"
the original code looks like this:
x <- c(12, 15, 18, 21)
for(i in 1:length(x)) { prt_reduced[,x[i]] <- reorder(prt_reduced[,x[i]], c(3,4,1,2)) }
x <- c(13, 16, 19, 22)
for(i in 1:length(x)) { prt_reduced[,x[i]] <- reorder(prt_reduced[,x[i]], c(3,1,2)) }
x <- c(14, 17, 20, 23)
for(i in 1:length(x)) { prt_reduced[,x[i]] <- reorder(prt_reduced[,x[i]], c(2,1)) }
(the first two loops work without an error message only the last one is transformed in a strange way.
hope that helps ..?
On 14.10.2011, at 11:20, Hans-Jörg Bibiko wrote:
>
> On 13 Oct 2011, at 23:23, Martin Batholdy wrote:
>> I start the Rdaemon with CMD+enter and then execute selected lines with the "execute selection" menu item.
>> A small window pops up with a progress bar and the message "sending task to Rdaemon".
>> After this is finished the selection converts to R-output.
>>
>> I don't have a separate R-window open.
>
>
>> The script is actually not that large.
>> It is just about 200 lines of code (8kb on disk).
>>
>> But since I get this strange parsing-behavior always at the end of the script, I thought it has something to do with that.
>
> Hi Martin,
>
> ok, I got it [Rdaemon offers flexible workflows ;) ]
>
>
> The point is that the output of the R console which runs in the background will be parsed by a Perl script to clean the output since it could contain many control characters etc. I guess that's the problem.
>
> Important: Which MacOSX and R version do you running?
>
> and
>
> Please do the following:
> - start a new Rdaemon session
> - execute your R code in question
> - go to the "R Console (Rdaemon)" menu > "Rdaemon Tools" > "Logfiles" > "Open console log file r_out" [short-cut ⌥⌘T]
> - a new window should appear showing the RAW output of the current R session's output [don't be confused ;)]
> - check the window's content for any confidential data and if you can send me the content please do this:
> -- open Finder; go to ~/Library/Application Support/Rdaemon; and send me the file "r_out" [please do not copy/save the content file to another file since editors can "destroy" its content due to possible control characters]
>
> With this I can check the Perl script. Maybe I missed some output sequences to catch.
>
> Best,
> --Hans
>
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
More information about the textmate
mailing list