Displaying 20 results from an estimated 9000 matches similar to: "clients and carriage returns"
2025 Feb 05
4
Looking for simple line-splitting code
If I have this object:
x <- c("abc\ndef", "", "ghi")
and I write it to a file using `writeLines(x, "test.txt")`, my text
editor sees a 5 line file:
1: abc
2: def
3:
4: ghi
5:
which is what I'd expect: the last line in the editor is empty. If I
use `readLines("test.txt")` on that file, I get the vector
2025 Feb 05
1
Looking for simple line-splitting code
A 3rd option could be
scan(text=x, what="", blank.lines.skip=FALSE)
(all because readLines() doesn't obey the text=x convention, perhaps it should? I'm unsure whether the textConnection is left open in Rui's method.)
-pd
> On 5 Feb 2025, at 15:35 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> Thanks to Rui, Peter and Tanvir! Peter's seems
2025 Feb 05
2
Looking for simple line-splitting code
Thanks to Rui, Peter and Tanvir! Peter's seems to be the fastest of the
3 suggestions so far on the little test case, but on the real data
(where x contains several thousand lines), Rui's seems best.
Duncan
On 2025-02-05 9:13 a.m., peter dalgaard wrote:
> This also seems to work:
>
>> strsplit(paste(x,collapse="\n"),"\n")[[1]]
> [1] "abc"
2025 Feb 05
1
Looking for simple line-splitting code
On Wed, 5 Feb 2025 08:44:12 -0500
Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> If I have this object:
>
> x <- c("abc\ndef", "", "ghi")
>
> and I write it to a file using `writeLines(x, "test.txt")`, my text
> editor sees a 5 line file:
>
> 1: abc
> 2: def
> 3:
> 4: ghi
> 5:
>
2025 Feb 05
1
Looking for simple line-splitting code
This also seems to work:
> strsplit(paste(x,collapse="\n"),"\n")[[1]]
[1] "abc" "def" "" "ghi"
> On 5 Feb 2025, at 14:44 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> If I have this object:
>
> x <- c("abc\ndef", "", "ghi")
>
> and I write it to a file
2003 Aug 24
1
declarations in non-exported headers and embedding R
Hello,
I've been using R embedded in PL/R (R procedural language handler for
PostgreSQL, http://www.joeconway.com/plr/) very successfully for several
months now. A sincere "thank you" goes to the R development team for
such a great product.
I have a question I'm hoping someone here can help me with. In order to
get the required functionality out of PL/R, I've had to
2006 Apr 18
2
typos in src/main/gram.y (PR#8780)
In src/main/gram.y, the documentation for R_ParseVector has a wrong
signature:
SEXP R_ParseVector(TextBuffer *text, int n, ParseStatus *status)
should be
SEXP R_ParseVector(SEXP text, int n, ParseStatus *status)
In addition, the two occurrences of "IOBuffer" in the documentation
should be replaced by "IoBuffer".
version.string = Version 2.3.0 beta (2006-04-14 r37779)
2005 Mar 18
2
Trouble debugging with gdb, R on Windows
I'm trying to follow the example in the R for Windows FAQ on running
gdb and am getting stuck because gdb tells me "Cannot access memory at
address ...".
Here's what my gdb session looks like (This one from a cygwin shell,
but same results from plain Windows CMD shell):
$ cd R-devel/src/gnuwin32
$ gdb ../../bin/Rgui.exe
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation,
2019 Dec 14
2
Inconsistent behavior for the C AP's R_ParseVector() ?
Le lun. 9 d?c. 2019 ? 09:57, Tomas Kalibera <tomas.kalibera at gmail.com> a
?crit :
> On 12/9/19 2:54 PM, Laurent Gautier wrote:
>
>
>
> Le lun. 9 d?c. 2019 ? 05:43, Tomas Kalibera <tomas.kalibera at gmail.com> a
> ?crit :
>
>> On 12/7/19 10:32 PM, Laurent Gautier wrote:
>>
>> Thanks for the quick response Tomas.
>>
>> The same error
2019 Dec 07
2
Inconsistent behavior for the C AP's R_ParseVector() ?
Thanks for the quick response Tomas.
The same error is indeed happening when trying to have a zero-length
variable name in an environment. The surprising bit is then "why is this
happening during parsing" (that is why are variables assigned to an
environment) ?
We are otherwise aware that the error is not occurring in the R console,
but can be traced to a call to R_ParseVector() in
2019 Dec 09
3
Inconsistent behavior for the C AP's R_ParseVector() ?
Le lun. 9 d?c. 2019 ? 05:43, Tomas Kalibera <tomas.kalibera at gmail.com> a
?crit :
> On 12/7/19 10:32 PM, Laurent Gautier wrote:
>
> Thanks for the quick response Tomas.
>
> The same error is indeed happening when trying to have a zero-length
> variable name in an environment. The surprising bit is then "why is this
> happening during parsing" (that is why
2019 Nov 30
2
Inconsistent behavior for the C AP's R_ParseVector() ?
Hi again,
Beside R_ParseVector()'s possible inconsistent behavior, R's handling of
zero-length named elements does not seem consistent either:
```
> lst <- list()
> lst[[""]] <- 1
> names(lst)
[1] ""
> list("" = 1)
Error: attempt to use zero-length variable name
```
Should the parser be made to accept as valid what is otherwise possible
2000 Jun 26
1
using graphapp.h
Another question
"graphapp.h" in R1.1 defines number of plotting function. is there an
example of how to use them?
Thank.
---------------------------
Vadim Kutsyy
vadim at kutsyy.com
http://www.kutsyy.com
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2000 Jun 26
1
using graphapp.h
Another question
"graphapp.h" in R1.1 defines number of plotting function. is there an
example of how to use them?
Thank.
---------------------------
Vadim Kutsyy
vadim at kutsyy.com
http://www.kutsyy.com
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2007 May 23
2
Possible ld.exe problem when building
Dear R People:
I am trying to build R-2.5.0 from source on a Windows machinee.
I downloaded the tools and such, and started things off.
I received some odd errors messages, looked on the R Search
and found a similar problem. The suggestion was to re-load
"ld.exe".
I downloaded and installed everything again. Same problem.
I am including my output.
2008 Aug 04
2
Parsing code with newlines
Dear List,
When I try to parse code containing newline characters with R_ParseVector, I
get a compilation error. How can I compile code that includes comments and
newlines?
I am using the following:
void* my_compile(char *code)
{
SEXP cmdSexp, cmdExpr = R_NilValue;
ParseStatus status;
PROTECT (cmdSexp = allocVector (STRSXP, 1));
SET_STRING_ELT (cmdSexp, 0, mkChar (code));
2019 Nov 30
2
Inconsistent behavior for the C AP's R_ParseVector() ?
Hi,
The behavior of
```
SEXP R_ParseVector(SEXP, int, ParseStatus *, SEXP);
```
defined in `src/include/R_ext/Parse.h` appears to be inconsistent depending
on the string to be parsed.
Trying to parse a string such as `"list(''=1+"` sets the
`ParseStatus` to incomplete parsing error but trying to parse
`"list(''=123"` will result in R sending a message to the
2019 Dec 14
1
Inconsistent behavior for the C AP's R_ParseVector() ?
Hi Simon,
Widespread errors would have caught my earlier as the way that code is
using only one initialization of the embedded R, is used quite a bit, and
is covered by quite a few unit tests. This is the only situation I am aware
of in which an error occurs.
What is a "correct context", or initial context, the code should from ?
Searching for "context" in the R-exts manual
1998 Sep 16
4
R-beta: A new version of R-0.62.3 for Win3.1/Win32s, Win95 and WinNT
I have just made available on ftp://sirio.stat.unipd.it/pub/R a
new version of R for MsWindows compiled with gcc-mingw32.
Enclosed you can find the README. Since there are many news
(with respect to my previous port, rw0613), please read it.
guido
------------------------ README ----------------------------------------
rw0623b.zip is a binary distribution of R (based on the last
1998 Sep 16
4
R-beta: A new version of R-0.62.3 for Win3.1/Win32s, Win95 and WinNT
I have just made available on ftp://sirio.stat.unipd.it/pub/R a
new version of R for MsWindows compiled with gcc-mingw32.
Enclosed you can find the README. Since there are many news
(with respect to my previous port, rw0613), please read it.
guido
------------------------ README ----------------------------------------
rw0623b.zip is a binary distribution of R (based on the last