Displaying 20 results from an estimated 6000 matches similar to: "performance of nchar"
2009 Mar 18
2
Profiling question: string formatting extremely slow
Hi all,
I'm using R to find duplicates in a set of 6 files containing Part Number
information. Before applying the intersect method to identify the duplicates
I need to normalize the P/Ns. Converting the P/N to uppercase if
alphanumerical and applying an 18 char long zero padding if numerical.
When I apply the pn_formatting function (see code below) to "Part Number"
column of the
2009 Jul 09
1
merge performace degradation in 2.9.1
I have noticed a significant performance degradation using merge in 2.9.1
relative to 2.8.1. Here is what I observed:
N <- 100000
X <- data.frame(group=rep(12:1, each=N), mon=rep(rev(month.abb), each=N))
X$mon <- as.character(X$mon)
Y <- data.frame(mon=month.abb, letter=letters[1:12])
Y$mon <- as.character(Y$mon)
Z <- cbind(Y, group=1:12)
system.time(Out
2012 Sep 14
1
please comment on my function
this function is supposed to canonicalize the language:
--8<---------------cut here---------------start------------->8---
canonicalize.language <- function (s) {
s <- tolower(s)
long <- nchar(s) == 5
s[long] <- sub("^([a-z]{2})[-_][a-z]{2}$","\\1",s[long])
s[nchar(s) != 2 & s != "c"] <- "unknown"
s
}
2009 Aug 24
1
nchar on factors
In R 2.9.1 Windows:
> nchar(factor(paste('sdf',1:10)))
[1] 1 1 1 1 1 1 1 1 2 1
so it appears that nchar is counting the number of characters in the numeric
representation, just like:
> nchar(as.numeric(factor(paste('sdf',1:10))))
[1] 1 1 1 1 1 1 1 1 2 1
but ?nchar says explicitly:
x: character vector, or a vector to be coerced to a character
vector.
2015 Oct 05
2
Error generated by .Internal(nchar) disappears when debugging
Hi all,
I have a puzzling problem related to nchar. In R 3.2.1, the internal nchar
gained an extra argument (see
https://stat.ethz.ch/pipermail/r-announce/2015/000586.html)
I've been testing code using the package copula, and at home I'm still
running R 3.2.0 (I know, I know...). When trying the following code, I got
an error:
> library(copula)
> fgmCopula(0.8)
Error in
2015 Oct 06
1
Error generated by .Internal(nchar) disappears when debugging
On 05/10/2015 8:25 PM, Matt Dowle wrote:
>
> On Mon, Oct 5, 2015 at 4:57 PM, Duncan Murdoch <murdoch.duncan at gmail.com
> <mailto:murdoch.duncan at gmail.com>> wrote:
>
> On 05/10/2015 7:24 PM, Matt Dowle wrote:
> > Joris Meys <jorismeys <at> gmail.com <http://gmail.com>> writes:
> >
> >>
> >> Hi all,
2015 Oct 07
1
Error generated by .Internal(nchar) disappears when debugging
Malcolm,
I tested the code on a clean R 3.2.0 session. Not even in RStudio, just to
rule that out.
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5]
2013 Apr 05
2
line profiling
Hello,
This is about the new "line profiling" feature in R 3.0.0. As I was
testing it, I find the results somewhat disappointing so I'd like to
get your opinion.
I put some poorly written code in a test.R file, here are the contents:
double <- function(x) {
out <- c()
for (i in x) {
out <- c(out, 2*i) # line 4
}
return(out)
}
Then this how I source the file
2001 Mar 28
2
nchar on data.frames
I don't understand why nchar() gives different string lengths for vectors
in a list than it does for vectors in a dataframe. Here's a snippet of
code:
> temp <- list(text=c("thug","jimbob","apple","thug"),numbers=1:4)
> nchar(temp$text)
[1] 4 6 5 4
> temp <- data.frame(temp)
> nchar(temp$text)
[1] 1 1 1 1
Could someone explain
2007 Aug 23
2
read big text file into R
Dear Rs:
Hi, I am trying to read a big text file (nrows=243440, ncols=144). It
seems the computational time of all the read methods
(scan,readtable,read.delim) is not linear to the number of rows I
want to read in: things became really slow once I tried to read in
100000 lines compare to 10000 lines).
If I am reading the profiling result right, I guess scan wouldn't
help either.
My
2003 Aug 29
2
length() and nchar()
I would propose to add "
See also:
`nchar' for counting the number of character in
character vectors.
"
to the helpfile of length(),
because it is rather difficult
to find nchar() if one has only
search terms as "length", "len",
"strlen" in mind.
Sincerly
Wolfram Fischer
2015 Apr 24
2
Development version of R: Improved nchar(), nzchar() but changed API
Those of you who track R development closely,
will have noticed yesterday's commit of enhanced versions of
nchar() and nzchar().
------------------------------------------------------------------------
r68254 | maechler | 2015-04-23 18:06:37 +0200 (Thu, 23 Apr 2015) | 1 line
Changed paths:
M doc/NEWS.Rd
M src/library/base/R/New-Internal.R
M src/library/base/R/zzz.R
M
2012 Dec 11
1
Debian packaging and openblas related crash when profiling in R
Hello R-sig-debian and (hopefully) Dirk:
On Debian wheezy, I have the R packaging that CRAN (you) provide. I
run into a little trouble while trying to fiddle with alternative
BLAS.
I know you and I went around on this last year and I think perhaps
I've found something wrong in the framework, or I've just done
something wrong.
I installed the packages openblas-base and openblas-dev, and
2007 Oct 22
2
Help interpreting output of Rprof
Hello there,
I am not quite sure how to interpret the output of Rprof (in the following the output I was staring at). I was poking around the web a little bit for documentation but without much success. I guess if I want to figure out what takes so long in my code the 2nd table $by.total and the total.pct column (pct = percent) is the most helpful. What does it mean that [ or [.data.frame is
2010 Jun 18
2
nchar( NA )
Hello,
Is this expected ?
> nchar( c( "", NA ) )
[1] 0 2
Should not the second one be NA ?
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/98Uf7u : Rcpp 0.8.1
|- http://bit.ly/c6YnCi : graph gallery collage
`- http://bit.ly/bZ7ltC : inline 0.3.5
2015 Oct 05
9
Error generated by .Internal(nchar) disappears when debugging
On 05/10/2015 7:24 PM, Matt Dowle wrote:
> Joris Meys <jorismeys <at> gmail.com> writes:
>
>>
>> Hi all,
>>
>> I have a puzzling problem related to nchar. In R 3.2.1, the internal
> nchar
>> gained an extra argument (see
>> https://stat.ethz.ch/pipermail/r-announce/2015/000586.html)
>>
>> I've been testing code using the
2009 Nov 10
1
standardGeneric seems slow; any way to get around it?
Hi,
I'm running some routines with standard matrix operations like solve() and
diag().
When I do a profile, the lead item under total time is standardGeneric().
Furthermore, solve() and diag() have much greater total time than self time.
???
I assume there is some time-consuming decision going on in the usual
functions;
is there any way to avoid that and go straight to the calculaions?
Thanks
2005 Jul 01
2
the format of the result
I write a function to get the frequency and prop of a variable.
freq<-function(x,digits=3)
{naa<-is.na(x)
nas<-sum(naa)
if (any(naa))
x<-x[!naa]
n<-length(x)
ta<-table(x)
prop<-prop.table(ta)*100
res<-rbind(ta,prop)
rownames(res)<-c("Freq","Prop")
cat("Missing value(s) are",nas,".\n")
cat("Valid case(s)
2009 Mar 03
1
profiler and loops
Hello,
(This is follow up from this thread:
http://www.nabble.com/execution-time-of-.packages-td22304833.html but
with a different focus)
I am often confused by the result of the profiler, when a loop is
involved. Consider these two scripts:
script1:
Rprof( )
x <- numeric( )
for( i in 1:10000){
x <- c( x, rnorm(10) )
}
Rprof( NULL )
print( summaryRprof( ) )
script2:
2015 Apr 27
1
Development version of R: Improved nchar(), nzchar() but changed API
Dear Martin,
Does the work on nchar mean that bugs #16090 and #16091 will be resolved
[1,2]?
Thanks,
Mark
[1] https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16090
[2] https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16091
On Sat, Apr 25, 2015 at 11:06 PM, James Cloos <cloos at jhcloos.com> wrote:
> >>>>> "GC" == G?bor Cs?rdi <csardi.gabor at