Displaying 20 results from an estimated 300 matches similar to: "more powerful iconv"
2007 Sep 13
1
chartr better
For example, the following changes are necessary when i convert a
Japanese hiragana into katakana in chattr.
R code:
> chartr("\u3041-\u3093","\u30a1-\u30f3","\u3084\u3063\u305f\u30fc")
--- R-alpha.orig/src/main/character.c 2007-09-05 07:13:27.000000000 +0900
+++ R-alpha/src/main/character.c 2007-09-13 16:10:21.000000000 +0900
@@ -2041,6 +2041,16 @@
2018 Mar 29
2
Possible `substr` bug in UTF-8 Corner Case
I think there is a memory bug in `substr` that is triggered by a UTF-8 corner case: an incomplete UTF-8 byte sequence at the end of a string.? With a valgrind level 2 instrumented build of R-devel I get:
> string <- "abc\xEE"??? # \xEE indicates the start of a 3 byte UTF-8 sequence
> Encoding(string) <- "UTF-8"
> substr(string, 1, 10)
==15375== Invalid read of
2016 May 12
3
Suggestion: mkString(NULL) should be NA
I would like to propose that Rf_mkString(NULL) and Rf_mkChar(NULL)
return NA rather than segfault.
Case: the mkString() and mkChar() functions are convenient to wrap
strings returned by e.g. external C libraries into an R vector.
However sometimes a library returns NULL instead of a string when the
result is unavailable. In some C libraries this can happen
unexpectedly or is even undocumented.
A
2008 Apr 10
2
QP.solve, QPmat, constraint matrix, and positive definite
hello all,
i'm trying to use QPmat, from the popbio package. it appears to be based
on solve.QP and is intended for making a population projection matrix.
QPmat asks for: nout, A time series of population vectors and C, C
constraint matrix, (with two more vectors, b and nonzero). i believe the
relevant code from QPmat is:
function (nout, C, b, nonzero)
{
if (!"quadprog" %in%
2023 Feb 23
1
Compilation Error when DEBUG_approx Toggled on in RISC-V
Hi all,
While compiling R to RISC-V64 architecture and debugging in R's C source
codes, I think I have found a small bug. Can anyone please verify whether
it is a real bug?
The possible bug lies in the file `R-4.2.2/src/library/stats/src/approx.c`
in function `R_approxfun` around line 148:
#ifdef DEBUG_approx
REprintf("R_approxfun(x,y, nxy = %.0f, .., nout = %.0f, method = %d,
2010 Feb 22
1
shash in unique.c
Looking at shash in unique.c, from R-2.10.1 I'm wondering if it makes sense
to hash the pointer itself rather than the string it points to?
In other words could the SEXP pointer be cast to unsigned int and the usual
scatter be called on that as if it were integer?
shash would look like a slightly modified version of ihash like this :
static int shash(SEXP x, int indx, HashData *d)
{
2010 Feb 16
3
error : unused argument(s) when boxplot
Dear all,
I am a total beginner in R, so sorry if this is the wrong place. I am using R 2.10.1 on a Mac (Mac OS 10.6.2).
I have this small dataset :
growth sugar
75 C
72 C
73 C
61 F
67 F
64 F
62 S
63 S
I have no problem reading the table, or getting the summary, but if I try boxplot(growth~sugar, ylab="growth", xlab="sugar", data=Dataset), I have the following error :
2004 Apr 18
2
outliers using Random Forest
Hello,
Does anybody know if the outscale option of randomForest yields the
standarized version of the outlier measure for each case? or the results
are only the raw values. Also I have notice that this measure presents
very high variability. I mean if I repeat the experiment I am getting very
different values for this measure and it is hard to flag the outliers.
This does not happen with two other
2012 Mar 03
1
Sliding Window in R (solved)
Dear all,
you can find below my solution for sliding a window. Please find below the code for the two alternatives and the benchmarks.
install.packages('caTools')
require(caTools)
do_sliding_for_a_window_duty_cycle <- function(DataToAnalyse, windowSize) {
data<-DataToAnalyse
out <- numeric()
elements<- numeric()
if (length(data[,1]) >= windowSize){
for
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very
long standing) with respect to the R_print.na_string and
R_print.na_string_noquote fields of the static R_print structure
declared in Print.h. This shows up very occassionally as incorrect
output from the following lines in reg-tests-2.R:
x <- c("a", NA, "b")
factor(x)
factor(x, exclude="")
2007 Jul 23
1
CHAR(STRING_ELT( - OK but CHAR(asChar(STRING_ELT( - not, why?
Any idea why CHAR(asChar(STRING_ELT( produces NA whereas
CHAR(STRING_ELT( gets a pointer to a string? It's generally expected
that STRING_ELT should already be a character, but why the coercion does
not work? Here is a simple example (consistent over R2.5.1-R2.6 rev
42284, I didn't check earlier versions, but it used to be different in
2.4):
install.packages("inline")
2012 Mar 13
0
111 FIXMEs in main/src
Hi,
We sometimes see offers to contribute, asking what needs to be done. If
they know C, how about the 111 FIXMEs? But which ones would be most
useful to fix? Which are difficult and which are easy? Does R-core have
a process to list and prioritise the FIXMEs?
~/R/Rtrunk/src/main$ grep "[^/]FIXME" * | wc -l
111
~/R/Rtrunk/src/main$ grep -A 1 "[^/]FIXME" *
arithmetic.c:/*
2019 Nov 04
2
Questions on the R C API
Hi All,
I have some questions regarding the R C API.
Let's assume I have a function which is defined as follows:
R file:
myfunc <- function(a, b, ...) .External(Cfun, a, b, ...)
C file:
SEXP Cfun(SEXP args) {
args = CDR(args);
SEXP a = CAR(args); args = CDR(args);
SEXP b = CAR(args); args = CDR(args);
/* continue to do something with remaining arguments in "..."
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
Identified as root cause of a bug in data.table:
https://github.com/Rdatatable/data.table/issues/3267
On my machine, strtoi("", base = 2L) produces NA_integer_ (which seems
consistent with ?strtoi: "Values which cannot be interpreted as integers or
would overflow are returned as NA_integer_").
But on all the other machines I've seen, 0L is returned. This seems to be
2005 Sep 20
3
annotating an axis in bwplot (lattice)
Hi,
I'd like to add, say, the sample size for every group in a bwplot as a
parenthetical annotation to the axis. Here's a sketch:
--8<---------------cut here---------------start------------->8---
require(Hmisc)
age <- sample(1:100, 1000, replace = TRUE)
sex <- gl(2, 8, 1000, c("Male", "Female"))
grp <- gl(4, 6, 1000, letters[1:4])
bwplot(grp ~ age |
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
>>>>> Martin Maechler
>>>>> on Fri, 11 Jan 2019 09:44:14 +0100 writes:
>>>>> Michael Chirico
>>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes:
>> Identified as root cause of a bug in data.table:
>> https://github.com/Rdatatable/data.table/issues/3267
>> On my machine, strtoi("", base =
2007 Sep 07
1
"bug" and patch: quadratic running time for strsplit(..., fixed=TRUE) (PR#9902)
Full_Name: John Brzustowski
Version: R-devel-trunk, R-2.4.0
OS: linux, gcc 4.0.3
Submission from: (NULL) (206.248.157.184)
This isn't a bug, but an easily-remedied performance issue.
SYMPTOM
> for (i in 1000 * (1:20)) {
y <- paste(rep("asdf", times=i), collapse=" ")
t <- system.time(strsplit(y, " ", fixed=TRUE))
cat(sprintf("i=%5d
2003 May 25
0
surprising behaviour of "bgroup": sets all in greek letters (PR#3099)
Let me summarize the bug reported by Ulf Martin on R-help with the same
subject line.
The code
plot(1:10)
text(1, 9, expression(F == bgroup("{", x, "")))
results in greek letters, which is not expected here.
That happens if the user tries to set only a left delimeter, the same with:
text(2, 8, expression(F == bgroup("{", x, ".")))
or
2011 Jan 25
1
NA printing
Hi.
I'm writing a print method for an object that includes a numeric matrix
for which
the lower diagonal elements are not meaningful. So I make the lower
diagonal of my matrix NA and print it.
But my co-author does not like NA there and wants a dash.
I have tried coercing the matrix to character, essentially by
M[is.na(M)] <- "-" but this interferes with the pleasing
column
2007 Jul 13
1
ldap/pam authentication
Hello,
I was wondering if there is an easy way to authenticate users through
ldap, or pam (which uses ldap). In our current setup samba uses tdbsam.
I would like users to be authenticated to our existing ldap server
(slapd on debian etch). So that if the user has been authenticated
successfully (s)he can access the directories as configured in smb.conf
(/home/username, /public etc.) with the