stephen sefick
2017-Apr-04 03:57 UTC
[R] system call removes special characters from text output
Hello, I am writing an R package, and I am using system() to call a perl script. The output of the perl script is correct except for "[A/B]" is output as "AB". Can someone explain this behavior. I would like to try and fix this. many thanks, Stephen Sefick -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]]
Jeff Newmiller
2017-Apr-04 04:23 UTC
[R] system call removes special characters from text output
Sorry, RPsychic package not found. Please install package reprex, apply it to your problem and try again. Note that if this problem can only be produced from within a package then there is an R-package-devel mailing list that would be a more appropriate place to ask. Also, if the problem is actually in the perl code or in the shell (this seems likely to me) then you probably need to look even further afield for help. -- Sent from my phone. Please excuse my brevity. On April 3, 2017 8:57:07 PM PDT, stephen sefick <ssefick at gmail.com> wrote:>Hello, > >I am writing an R package, and I am using system() to call a perl >script. >The output of the perl script is correct except for "[A/B]" is output >as >"AB". Can someone explain this behavior. I would like to try and fix >this. >many thanks, > >Stephen Sefick
stephen sefick
2017-Apr-04 04:44 UTC
[R] system call removes special characters from text output
Hi Jeff, My apologies for not providing enough information. The perl code works as expected at the shell (without calling it from R). I have tried the system call inside of an ESS R session and at a the shell. Both of these produce the unexpected result. I can provide whatever information that is needed. kindest regards, Stephen On Mon, Apr 3, 2017 at 11:23 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:> Sorry, RPsychic package not found. Please install package reprex, apply it > to your problem and try again. Note that if this problem can only be > produced from within a package then there is an R-package-devel mailing > list that would be a more appropriate place to ask. Also, if the problem is > actually in the perl code or in the shell (this seems likely to me) then > you probably need to look even further afield for help. > -- > Sent from my phone. Please excuse my brevity. > > On April 3, 2017 8:57:07 PM PDT, stephen sefick <ssefick at gmail.com> wrote: > >Hello, > > > >I am writing an R package, and I am using system() to call a perl > >script. > >The output of the perl script is correct except for "[A/B]" is output > >as > >"AB". Can someone explain this behavior. I would like to try and fix > >this. > >many thanks, > > > >Stephen Sefick >-- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]]
MacQueen, Don
2017-Apr-05 21:06 UTC
[R] system call removes special characters from text output
I can't reproduce this. On my system, the contents of an executable file named tmp.pl: #! /opt/local/bin/perl print "[A/B]\n"; At a shell prompt: [72]% ./tmp.pl [A/B] Inside R:> system(' ./tmp.pl')[A/B] -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 4/3/17, 8:57 PM, "R-help on behalf of stephen sefick" <r-help-bounces at r-project.org on behalf of ssefick at gmail.com> wrote: Hello, I am writing an R package, and I am using system() to call a perl script. The output of the perl script is correct except for "[A/B]" is output as "AB". Can someone explain this behavior. I would like to try and fix this. many thanks, Stephen Sefick -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
stephen sefick
2017-Apr-05 21:20 UTC
[R] system call removes special characters from text output
Don, Thank you for your reply. I found no problems in the perl script, but I found that I had inadvertently swapped file names in my call to system(" script.pl file1 file2") works as expected system(script.pl file2 file1) produces the output that formed my original query. Thanks so much, and I learned to not code after 10 PM. kindest regards, Stephen On Wed, Apr 5, 2017 at 4:06 PM, MacQueen, Don <macqueen1 at llnl.gov> wrote:> I can't reproduce this. > > On my system, the contents of an executable file named tmp.pl: > > #! /opt/local/bin/perl > print "[A/B]\n"; > > At a shell prompt: > > [72]% ./tmp.pl > [A/B] > > Inside R: > > > system(' ./tmp.pl') > [A/B] > > > -- > Don MacQueen > > Lawrence Livermore National Laboratory > 7000 East Ave., L-627 > Livermore, CA 94550 > 925-423-1062 > > > On 4/3/17, 8:57 PM, "R-help on behalf of stephen sefick" < > r-help-bounces at r-project.org on behalf of ssefick at gmail.com> wrote: > > Hello, > > I am writing an R package, and I am using system() to call a perl > script. > The output of the perl script is correct except for "[A/B]" is output > as > "AB". Can someone explain this behavior. I would like to try and fix > this. > many thanks, > > Stephen Sefick > > -- > Let's not spend our time and resources thinking about things that are > so > little or so large that all they really do for us is puff us up and > make us > feel like gods. We are mammals, and have not exhausted the annoying > little > problems of being mammals. > > -K. Mullis > > "A big computer, a complex algorithm and a long time does not equal > science." > > -Robert Gentleman > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > >-- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]]