Re: [Rd] read.csv

2024-04-16 Thread Rui Barradas
h/mailman/listinfo/r-devel Hello, I wrote a file with that content and read it back with read.csv("filename.csv", as.is = TRUE) There were no problems, it all worked as expected. Hope this helps, Rui Barradas -- Este e-mail foi analisado pelo software antivírus AVG para verific

Re: [Rd] round.Date and trunc.Date not working / implemented

2024-02-08 Thread Rui Barradas
n-numeric argument to mathematical function Sys.Date() |> round.Date("years") #> Error in NextMethod(): generic function not specified Sys.Date() |> round.POSIXt("years") #> [1] "2024-01-01 UTC" Sys.Date() |> round.POSIXt("months") #> [1] &qu

Re: [Rd] Rtools error

2023-11-27 Thread Rui Barradas
://stat.ethz.ch/mailman/listinfo/r-devel Hello, Have you checked it is in the PATH system variable? After installing Rtools you must edit the Windows PATH. It not, the system will still find the older Rtools version. Hope this helps, Rui Barradas -- Este e-mail foi analisado pelo software

Re: [Rd] Subset has No Examples for Vector Data

2023-10-10 Thread Rui Barradas
S #> 1 2 4 4 8 13 14 10 17 9 11 2 1 3 1 subset(tbl, tbl > 10) #> random #> H I K M #> 13 14 17 11 So it is subsetting vector data as wanted. It is your expectation that a part of the table should be returned that is not in agreement with the data you have. Hope thi

Re: [Rd] Use of `[` with array and resulting class

2023-09-30 Thread Rui Barradas
keep the dim attribute b[1, , , drop = FALSE] #> , , 1 #> #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,]123456 Hope this helps, Rui Barradas -- Este e-mail foi analisado pelo software antivírus AVG para verificar a presença de vírus. www.avg.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Rui Barradas
NCOL(x) NROW(x) Not very convincing? Maybe with time... Hope this helps, Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Bug in optim for specific orders of magnitude

2022-12-23 Thread Rui Barradas
swers much better than what I could. The very small numbers in your question seem to have hit a limit and this limit is not R related. [1] https://stat.ethz.ch/pipermail/r-help/2022-February/473840.html [2] https://stat.ethz.ch/pipermail/r-help/2022-February/473844.html Hope thi

Re: [Rd] as.Date without "origin"

2022-11-02 Thread Rui Barradas
d behavior. I was expecting class "integer", not "numeric" but this too is documented in ?Dates section Details 2nd paragraph. It is intended that the date should be an integer, but this is not enforced in the internal representation. Fractional days will be ignored when printing

Re: [Rd] Parser bug? A comma too much.

2022-09-20 Thread Rui Barradas
Hello, A bit late but thanks for the extra explanation. Rui Barradas Às 16:00 de 16/09/2022, peter dalgaard escreveu: As a general matter, empty arguments are allowed and are used meaningfully in some contexts, notably A[i,], which is syntactic sugarcoating of "["(A

Re: [Rd] simplify2array assumes non-NA dim() -- base or method bug?

2022-08-25 Thread Rui Barradas
ngth 1 vector, nrow returns that value and ncol's return is the expected behavior of subsetting past the vector length. dim(table(letters)) # length 1 # [1] 26 nrow(table(letters)) # works as expected # [1] 26 ncol(table(letters)) # works as expected # [1] NA Hope this helps, Rui Barradas

Re: [Rd] calloc() vs. R_Calloc()

2022-04-07 Thread Rui Barradas
And there are more cases like these. For what I've seen, the frequent (unique?) case is malloc/R_Free. Hope this helps, Rui Barradas Às 09:59 de 07/04/2022, Tomas Kalibera escreveu: On 4/7/22 10:32, Adrian Dușa wrote: On Thu, 7 Apr 2022 at 10:32, Tomas Kalibera wrote

Re: [Rd] string concatenation operator (revisited)

2021-12-04 Thread Rui Barradas
out saying that I do not speak for the R Core team. [1] https://stat.ethz.ch/pipermail/r-help/2021-December/473163.html Hope this helps, Rui Barradas Às 22:36 de 04/12/21, Grant McDermott escreveu: Hi all, I wonder if the R Core team might reconsider an old feature request, as detai

Re: [Rd] capturing multiple warnings in tryCatch()

2021-12-03 Thread Rui Barradas
626.html [3] https://stat.ethz.ch/pipermail/r-help/2004-June/052092.html [4] https://stat.ethz.ch/pipermail/r-help/2004-June/052132.html [5] https://CRAN.R-project.org/package=simsalapar Hope this helps, Rui Barradas Às 22:37 de 02/12/21, Fox, John escreveu: Dear Henrik, Simon, and Adrian,

Re: [Rd] Crash/bug when calling match on latin1 strings

2021-10-11 Thread Rui Barradas
is last line is Portuguese for Segmentation fault (core dumped) Hope this helps, Rui Barradas Às 06:05 de 11/10/21, Travers Ching escreveu: Here's a brief example: # A bunch of words in UTF8; replace *'s words <- readLines("h://pastebin.c**/raw/MFCQfhpY", encoding = "UTF

Re: [Rd] Trivial typo in help("browser")

2021-07-29 Thread Rui Barradas
Hello, Double thanks, for the correction and for the lesson. In particular, I had never noticed the f2() example's behavior. It's always good to learn something new. Rui Barradas Às 08:57 de 29/07/21, Martin Maechler escreveu: Rui Barradas on Thu, 29 Jul 2021 07:52:02 +0100 writes

Re: [Rd] Trivial typo in help("browser")

2021-07-29 Thread Rui Barradas
Hello, Thanks, you are absolutely right. I had noticed that last night and then I din't know what happened but it went like that. Thanks for the correction. Rui Barradas Às 07:59 de 29/07/21, Peter Langfelder escreveu: I'm also not a native speaker but my take is that a "be"

[Rd] Trivial typo in help("browser")

2021-07-29 Thread Rui Barradas
11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_4.1.0 Thanks to all R Core Team members for their great work for all of us.

Re: [Rd] Unexpected behavior of '[' in an apply instruction

2021-02-12 Thread Rui Barradas
Hello, Yes, although there is an accepted solution, I believe you should post this solution there. It's a base R solution, what the question asks for. And thanks, I would have never reminded myself of slice.index. Rui Barradas Às 20:45 de 12/02/21, robin hankin escreveu: Rui > x <-

[Rd] Unexpected behavior of '[' in an apply instruction

2021-02-12 Thread Rui Barradas
it to work, only the other way does: i <- 1L apply(x, MARGIN = -d, '[', i, drop = FALSE) x[i, , drop = FALSE] What am I missing? [1] https://stackoverflow.com/questions/66168564/is-there-a-native-r-syntax-to-extract-rows-of-an-array Thanks in advance

Re: [Rd] Small bug in the documentation of `[.data.frame`

2020-12-29 Thread Rui Barradas
Hello, Thank you both, Duncan and Martin, for the quick and clear answer. I hadn't considered printing `[.data.frame`, which is in fact very useful, but I had read the Arguments section. What I didn't realize was that it was the answer to the question. Sorry for the noise. Rui Barradas Às

[Rd] Small bug in the documentation of `[.data.frame`

2020-12-29 Thread Rui Barradas
] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_4.0.3 tools_4.0.3 Happy holidays, Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] New pipe operator

2020-12-05 Thread Rui Barradas
sugar? Or am I finding the syntax ugly? Hope this helps, Rui Barradas Às 03:22 de 06/12/20, Gregory Warnes escreveu: If we’re being mathematically pedantic, the “pipe” operator is actually function composition > That being said, pipes are a simple and well-known idiom. While being less

Re: [Rd] [R] Data Table not rendering properly using R shiny

2020-11-07 Thread Rui Barradas
Hello, Or maybe logical_idx <- max_usage_hours_per_region$Region %in% input$Region Another option is ?match Hope this helps, Rui Barradas Às 15:41 de 07/11/20, Jeff Newmiller escreveu: This looks odd... max_usage_hours_per_region[input$Region,] This would only work if you

Re: [Rd] [R] jitter-bug? problematic behaviour of the jitter function

2020-09-23 Thread Rui Barradas
this helps, Rui Barradas Às 11:32 de 23/09/20, Martin Keller-Ressel escreveu: Dear all, i have noticed some strange behaviour in the „jitter“ function in R. On the help page for jitter it is stated that "The result, say r, is r <- x + runif(n, -a, a) where n <- length(x) and a is

Re: [Rd] more Matrix weirdness

2020-09-09 Thread Rui Barradas
se other attached packages: [1] Matrix_1.2-18 loaded via a namespace (and not attached): [1] compiler_4.0.2 grid_4.0.2 lattice_0.20-41 Error in x[rr, cc] <- m : number of items to replace is not a multiple of replacement length Execution halted Hope this helps, Rui Barradas Às 03:04

[Rd] Typos in file.path documentation.

2020-08-10 Thread Rui Barradas
datasets methods base loaded via a namespace (and not attached): [1] compiler_4.0.2 Hope this helps, Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] order function called on a data.frame?

2020-05-18 Thread Rui Barradas
3 4 5 6 7 8 9 10 11 12 13 14 15 16 #[43] 17 18 19 20 21 22 23 24 25 26 And I agree that order with data.frames should give a warning. The result is indeed useless: data.frame(letters, 1:26)[order(data.frame(letters, 1:26)), ] Hope this helps, Rui Barradas Às 00:19 de 18/05/20, Jan

Re: [Rd] strange bahaviour of predict.lm

2020-03-17 Thread Rui Barradas
Hello, I'm glad that it worked. Two things: 1. Please, click reply all to keep this threaded. 2. The question should have belonged to r-h...@r-project.org, not to r-devel@r-project.org. Rui Barradas Às 07:10 de 17/03/20, Moshe Olshansky escreveu: It works, thank you! On Tuesday, 17 March

Re: [Rd] strange bahaviour of predict.lm

2020-03-17 Thread Rui Barradas
Hello, The problem seems to be that A is a matrix. The following solves the error. # create A and b as in your code then run A <- as.data.frame(A) df1 <- cbind(A, b) reg <- lm(b ~ ., df1) # etc Hope this helps, Rui Barradas Às 04:36 de 17/03/20, Moshe Olshansky via R-devel escreve

Re: [Rd] dput()

2020-02-28 Thread Rui Barradas
Hello, FAQ 7.31 See also this StackOverflow post: https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal Hope this helps, Rui Barradas Às 00:08 de 29/02/20, robin hankin escreveu: My interpretation of dput.Rd is that dput() gives an exact ASCII form of the internal

Re: [Rd] Why is any() only defined for a numeric and not logical data.frame?

2020-02-16 Thread Rui Barradas
t test if (!is.numeric(x) && !is.complex(x)) stop("only defined on a data frame with all numeric variables") So now the question is even more pertinent (?)(I think): If sum() is a valid instruction, why only sum() sum() are valid? Rui Barradas Às 19:23 d

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-04 Thread Rui Barradas
# "integer" class(0)# "numeric" typeof(0L) # "integer" typeof(0) # "double" Indices are integers, so I used integers and added 1L every iteration through the inner loop. This also means that in point 1. I should have indexed the matrix with p + 1

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-03 Thread Rui Barradas
s is the R-devel mailing list. Please do *NOT* misuse it for R-help questions in the future: These should go to the R-help mailing list instead! Yes, and I had noticed it but then, after writing down the answer, forgot to mention it. Thanks for the warning. Rui Barradas Best, Martin Maechler

Re: [Rd] Stroring and extracting AICs from an ARIMA model using a nested loop

2020-02-03 Thread Rui Barradas
tor("list", 16) i <- 0L for(p in 0:3){ for(q in 0:3){ i <- i + 1L storage1[[i]] <- arima(etc) } } lapply(storage1, '[[', "aic") # get the aic's. Maybe sapply is better it will return a vector. Hope this helps, Rui Barradas Às 06:23 de 03/02/20, ismael

Re: [Rd] inconsistent behaviour of c(...)

2019-07-19 Thread Rui Barradas
I forgot there is also ?mode. mode(c(1,"2")) # "character" mode(d.f$C)# "numeric" (not "integer") Rui Barradas Às 11:54 de 19/07/19, Rui Barradas escreveu: Hello, A way to see this is with ?class # OP's code typeof(c(1,"2")) # "

Re: [Rd] inconsistent behaviour of c(...)

2019-07-19 Thread Rui Barradas
Hello, A way to see this is with ?class # OP's code typeof(c(1,"2")) # "character" d.f <- data.frame(C=c(1,"2")) typeof(d.f$C)# "integer" # And check the objects' classes class(c(1,"2")) # "character" class(d.f$C)# &

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Rui Barradas
Hello, Inline. Às 14:26 de 15/07/19, Duncan Murdoch escreveu: On 15/07/2019 8:57 a.m., Rui Barradas wrote: Hello, Clean R 3.6.1 session on Ubuntu 19.04, RStudio 1.1.453. sessionInfo() at the end. That's not what I'd call a "clean session" with all those packages loaded: You

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Rui Barradas
3.1.1 [100] openxlsx_4.1.0 xfun_0.6survey_3.35-1 [103] survival_2.44-1.1 timeDate_3043.102 tibble_2.1.1 [106] memoise_1.1.0 cluster_2.0.8 toOrdinal_1.1-0.0 [109] fitdistrplus_1.0-14 brew_1.0-6 Hope this helps, Rui Barradas Às 13:16 de 15/07/19, Duncan Murdoch escreveu:

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Rui Barradas
Hello, Sorry, my mistake, I grossly misunderstood the question. qnorm(1e-300) #[1] -37.0471 Anyway, you cannot go much smaller. p <- 10^seq(-300, -400, by = -10) z <- qnorm(p/2) exp(z*z/2) Hope this helps, Rui Barradas Às 16:11 de 21/06/19, jing hua zhao escreveu: Dear Rui,

Re: [Rd] Calculation of e^{z^2/2} for a normal deviate z

2019-06-21 Thread Rui Barradas
=C [11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [many packages loaded] Hope this helps, Rui Barradas Às 15:24 de 21/06/19, jing hua zhao escreveu: Dear R-developers, I a

Re: [Rd] [R] Open a file which name contains a tilde

2019-06-08 Thread Rui Barradas
~ b') #[1] "a /home/rui b" Rui Barradas Às 04:27 de 08/06/19, Richard O'Keefe escreveu: ?path.expand Expand a path name, for example by replacing a leading tilde by the user's home directory (if defined on that platform). *A* path name. The argument is a character vector. If

Re: [Rd] [r-devel] integrate over an infinite region produces wrong results depending on scaling

2019-06-04 Thread Rui Barradas
base1 = integrate(f, -Inf, 0), base2 = integrate(f, -Inf, 0, numstab = sc), cuba1 = cubintegrate(f, -Inf, 0, method = "hcubature"), cuba2 = cubintegrate(f, -Inf, 0, method = "hcubature", numstab = sc) ) Hope this helps, Rui Barradas Às 15:52 de 12/04/19

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-26 Thread Rui Barradas
ts the vector of names of classes an object inherits from. So far, so good. But now comes the part I don't like. is.list(df1) #[1] TRUE Strictly speaking this is not unexpected behavior (because it's documented) but isn't it *inconsistent* behavior? Rui Barradas Às 16:30 de 26/03/2019, Berr

Re: [Rd] Exit status of Rscript

2019-02-28 Thread Rui Barradas
PT.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods [7] base loaded via a namespace (and not attached): [1] compiler_3.5.2 tools_3.5.2yaml_2.2.0 Hope this helps, Rui Barradas Às 12:23 de 28/02/2019, Michel Lang escreveu: Curr

Re: [Rd] Intermittent crashes with inset `[<-` command

2019-02-27 Thread Rui Barradas
AME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.5.2 Hope this helps, Rui Barradas Às 08:46 de 27/02/2019,

Re: [Rd] Return/print standard error in t.test()

2019-02-21 Thread Rui Barradas
of the difference:", se, "\n\n") invisible(x) } t.test2(1:10, y = c(7:20)) t.test2(extra ~ group, data = sleep) # last example from ?t.test (The suffix tjl commes from the OP's initials.) Hope this helps, Rui Barradas Às 21:51 de 21/02/2019, Fox, John escreveu: Dear Thomas,

Re: [Rd] nlminb with constraints failing on some platforms

2019-02-01 Thread Rui Barradas
t, tol=0) # good: 5.53 e-7 #[1] "Mean relative difference: 5.534757e-07" all.equal(opt$objective, f(xhat), tol=0) # good: 1.8 e-12 #[1] "Mean relative difference: 1.816536e-12" abs( opt$objective - f(xhat) ) < 1e-4 ## Must be TRUE #[1] TRUE Hope this helps, Rui Barradas sessio

Re: [Rd] Subsetting row in single column matrix drops names in resulting vector

2018-11-21 Thread Rui Barradas
Hello, Use drop = FALSE. a[1, , drop = FALSE] # col1 #row11 Hope this helps, Rui Barradas Às 16:51 de 21/11/2018, Dmitriy Selivanov escreveu: Hello here. I'm struggling to understand R's subsetting behavior in couple of edge cases - subsetting row in a single column matrix

Re: [Rd] Warning when calling formals() for `[`.

2018-10-07 Thread Rui Barradas
Hello, This is because args(`[`) returns NULL and class(NULL) is NULL. So the question would be why is the return value of args(`[`) NULL? Rui Barradas Às 15:14 de 07/10/2018, Peter Dalgaard escreveu: On 7 Oct 2018, at 16:04 , Rui Barradas wrote: Hello, I don't see why you say

Re: [Rd] Warning when calling formals() for `[`.

2018-10-07 Thread Rui Barradas
2 (I first tried this last call with the argument between back ticks and it didn't work, I wonder why.) Hope this helps, Rui Barradas Às 18:52 de 06/10/2018, Laurent Gautier escreveu: Hi, Thanks for the note. How would explain the following snippet taken from `formals` doc page (the code c

Re: [Rd] Warning when calling formals() for `[`.

2018-10-07 Thread Rui Barradas
Hello, I don't see why you say that the documentation seems to be wrong: class(args(`+`)) #[1] "function" args() on a primitive does return a closure. At least in this case it does. Rui Barradas Às 14:05 de 07/10/2018, Peter Dalgaard escreveu: There is more "fun" afo

Re: [Rd] Warning when calling formals() for `[`.

2018-10-06 Thread Rui Barradas
Hello, I forgot to ask you to also try to break the `sum` instruction into its components: args(`sum`) does return a function. Therefore formals(args(`sum`)) returns something useable and no warning. Rui Barradas Às 18:42 de 06/10/2018, Rui Barradas escreveu: Hello, I believe

Re: [Rd] Warning when calling formals() for `[`.

2018-10-06 Thread Rui Barradas
Hello, I believe that this is maybe not a *feature* but at least expected behaviour. The call formals(args(`[`)) breaks down to > args(`[`) NULL > formals(NULL) NULL Warning message: In formals(fun) : argument is not a function Hope this helps, Rui Barradas Às 18:26 de 06/1

Re: [Rd] R grpc

2018-10-02 Thread Rui Barradas
Hello, Do you really need a prebuild binary? Wouldn't this do it? devtools::install_github("nfultz/grpc") Hope this helps, Rui Barradas Às 20:14 de 02/10/2018, Witold E Wolski escreveu: Hello, I am looking for a prebuild - binary MS Windows version of the R grpc package https://

Re: [Rd] compairing doubles

2018-09-03 Thread Rui Barradas
bit. isTRUE(all.equal(0.3, 0.1*3)) #[1] TRUE `%~~%` <- function (e1, e2) isTRUE(all.equal(e1, e2)) 0.3 %~~% 0.1*3 #[1] 0 0.3 %~~% (0.1*3) #[1] TRUE Hope this helps, Rui Barradas Às 08:20 de 03/09/2018, Juan Telleria Ruiz de Aguirre escreveu: Maybe a new Operator could be defined for

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Rui Barradas
ely different, there's more to 'if' than '||' and '&&'. Any change should be done with increased care. (Which I'm sure will, as always.) Rui Barradas Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Aug 30, 2018 at 7:16 AM, Hadley Wickham wrote: I think this is an excellent ide

Re: [Rd] Is this a bug in `[`?

2018-08-28 Thread Rui Barradas
he result was of length zero, I was just using seq_len(result) to avoid the test. And found the error surprising. Thanks again, Rui Barradas The rest of that section is very useful and well written. I used it as the go-to reference to implement support for all those indexing alternatives in m

Re: [Rd] plotmath degree symbol

2018-08-26 Thread Rui Barradas
Hello, Same here. Tested on R 3.1.1 and R 3.5.1 and they look *exactly* the same. Hope this helps, Rui Barradas On 26/08/2018 22:36, Paul Murrell wrote: Hi Sorry, but this seems to be working ok for me ... > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-

Re: [Rd] bug report: inaccurate error message for stats::chisq.test

2018-08-22 Thread Rui Barradas
Hello, A workaround could be y <- addNA(y) chisq.test(x,y) But this implies that the user was aware of the reason why the error. Hope this helps, Rui Barradas On 21/08/2018 15:31, Ant F wrote: Hi, `stats::chisq.test` checks that x and y each have at least 2 levels AFTER filter

Re: [Rd] Is this a bug in `[`?

2018-08-05 Thread Rui Barradas
Thanks, This is what I needed. I had read the R Inferno a long time ago and apparently forgot this one. Rui Barradas Às 08:46 de 05/08/2018, Patrick Burns escreveu: This is Circle 8..1.13 of the R Inferno. On 05/08/2018 06:57, Rui Barradas wrote: Thanks. This is exactly the doubt I had

Re: [Rd] Is this a bug in `[`?

2018-08-04 Thread Rui Barradas
Thanks. This is exactly the doubt I had. Rui Barradas Às 05:26 de 05/08/2018, Kenny Bell escreveu: This should more clearly illustrate the issue: c(1, 2, 3, 4)[-seq_len(4)] #> numeric(0) c(1, 2, 3, 4)[-seq_len(3)] #> [1] 4 c(1, 2, 3, 4)[-seq_len(2)] #> [1] 3 4 c(1, 2, 3, 4)[-seq_len(

Re: [Rd] Is this a bug in `[`?

2018-08-04 Thread Rui Barradas
Às 15:51 de 04/08/2018, Iñaki Úcar escreveu: El sáb., 4 ago. 2018 a las 15:32, Rui Barradas () escribió: Hello, Maybe I am not understanding how negative indexing works but 1) This is right. (1:10)[-1] #[1] 2 3 4 5 6 7 8 9 10 2) Are these right? They are at least surprising

[Rd] Is this a bug in `[`?

2018-08-04 Thread Rui Barradas
(0) whould avoid an if/else or something similar. Thanks in advance, Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Bug in as.Date or strptime?

2018-06-22 Thread Rui Barradas
1] compiler_3.4.4 tools_3.4.4yaml_2.1.19 Or maybe I am missing something. Thanks in advance, Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] aggregate() naming -- bug or feature

2018-03-23 Thread Rui Barradas
versicolor5.936 #3 virginica6.588 Hope this helps, Rui Barradas On 3/23/2018 1:29 PM, Randall Pruim wrote: In the examples below, the first loses the name attached by foo(), the second retains names attached by bar(). Is this an intentional difference? I’d prefer that the names

Re: [Rd] split() - unexpected sorting of results

2017-10-20 Thread Rui Barradas
tr_order(as.character(x), numeric = TRUE) #[1] 1 4 11 8 6 5 3 10 9 7 2 i <- str_order(as.character(x), numeric = TRUE) as.character(x)[i] #[1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "1

Re: [Rd] Unexpected behaviour with download.packages on Windows

2017-09-29 Thread Rui Barradas
bit64_0.9-7 [52] glue_1.1.1 parallel_3.4.1 colorspace_1.3-2 [55] cluster_2.0.6 memoise_1.1.0 knitr_1.16 [58] bindr_0.1 Hope this helps, Rui Barradas Em 29-09-2017 16:00, Hong Ooi via R-devel escreveu: If no 'type' is specified, download.packages("pkgname") wi

Re: [Rd] Problem with a regular expression.

2017-08-17 Thread Rui Barradas
e_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Portugal.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.4

Re: [Rd] install.packages problem on Windows: CRANextras timeout

2017-07-17 Thread Rui Barradas
Hello, Thanks for the answer. No, in the end there's no problem, just a warning. Rui Barradas Em 17-07-2017 09:29, Martin Maechler escreveu: Rui Barradas <ruipbarra...@sapo.pt> on Mon, 17 Jul 2017 09:03:33 +0100 writes: > Hello, > R 3.4.1 on Windows 7, sessionInf

[Rd] install.packages problem

2017-07-17 Thread Rui Barradas
ckages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] igraph_1.0.1 loaded via a namespace (and not attached): [1] compiler_3.4.1 magrittr_1.5 tools_3.4.1 Thanks in advance, Rui Barradas __

Re: [Rd] "table(droplevels(aq)$Month)" in manual page of droplevels

2017-04-12 Thread Rui Barradas
oplevels(aq)["Month"] and droplevels(aq)$Month are _not_ the same. The first returns a data.frame (with just one vector), the latter returns a vector. To return just a vector you could also use droplevels(aq)[["Month"]] which is preferable for programming, by the

Re: [Rd] Downloader that Resolves library dependencies

2017-04-11 Thread Rui Barradas
Hello, Try ?install.packages from within R. install.packages("car", dependencies = TRUE) Hope this helps, Rui Barradas Em 11-04-2017 12:01, Ulrich Windl escreveu: Hi! If you want to install an extra library like "car", there is a long list of dependencies. If you just

Re: [Rd] Bug in new behaviour for all.equal and environments?

2014-09-21 Thread Rui Barradas
LC_NUMERIC=C [5] LC_TIME=Portuguese_Portugal.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base Rui Barradas Em 21-09-2014 18:06, Kevin Ushey escreveu: Hi R-devel, The following code: all.equal(baseenv(), baseenv()) gives the error when run

Re: [Rd] parallel::detectCores(TRUE) gives: Error in system(cmd, TRUE) : error in running command

2014-08-22 Thread Rui Barradas
LC_NUMERIC=C [5] LC_TIME=Portuguese_Portugal.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] parallel_3.1.1 Rui Barradas Best, Tobias __ R-devel@r

Re: [Rd] cat with backspace and newline characters

2013-11-01 Thread Rui Barradas
Hello, Can't reproduce it, there must be something with your console. I get cat(abc\b) ab cat(abc\b\n) ab Hope this helps, Rui Barradas Em 01-11-2013 11:06, Renaud Gaujoux escreveu: Hi, when mixing newline and backspace characters I get the following output (see below). In the second

Re: [Rd] extracting tables from web pages?

2013-04-25 Thread Rui Barradas
Hello, The following seems to work. library(XML) url - http://house.gov/representatives/; dat - readHTMLTable(readLines(url), which=1, header=TRUE) str(dat) head(dat) Hope this helps, Rui Barradas Em 25-04-2013 21:00, Spencer Graves escreveu: Hello: What tools would you recommend

Re: [Rd] bug in plot.ts?

2012-12-29 Thread Rui Barradas
of labels to be used. The default is to label for up to 150 points, and not for more. but I believe the documentation could be more clear. It could say that in the case of a y ~ x plot, to supress the plot xy.labels should be set to FALSE. Hope this helps, Rui Barradas Em 29-12-2012 17:04

Re: [Rd] bug in plot.ts?

2012-12-29 Thread Rui Barradas
it, documented plot.ts(x=1, y=1, type=n) # does show the plot (labels it), not properly documented plot.ts(x=1:151, y=1:151, type=n) # does not show the plot, documented Rui Barradas Em 29-12-2012 19:07, Rui Barradas escreveu: Hello, You're right, it has to do with the argument xy.labels. The relevant

[Rd] file.link on Windows 7

2012-12-08 Thread Rui Barradas
But there's something going on. The link is not created and the warning message is wrong. Bug report? (Why CreateHardLinkW, and not CreateHardLink?) Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] file.link on Windows 7

2012-12-08 Thread Rui Barradas
attached base packages: [1] stats graphics grDevices utils datasets methods base Rui Barradas Em 08-12-2012 11:38, Rui Barradas escreveu: Hello, A post to R-Help by Oliver Soong reports what seems to be a bug specific to Windows (I'm on Windows 7). The original post is as follows

Re: [Rd] memory management in C code

2012-12-07 Thread Rui Barradas
. Calloc/Realloc - you must call Free() [ uppercase, not free() ] at the end of the function call. Hope this helps, Rui Barradas Em 07-12-2012 12:40, Vineeth Mohan escreveu: Hi , I am a newbie to R and i am trying to create a R package which is pretty main memory intensive. I would like

Re: [Rd] Quiz: How to get a named column from a data frame

2012-08-18 Thread Rui Barradas
Hello, A bit more general nv - c(a=1, d=17, e=101); nv nv2 - c(a=a, d=d, e=e) df2 - data.frame(VAR = nv, CHAR = nv2); df2 identical( nv, drop(t( df2[1] )) ) # TRUE identical( nv, drop(t( df2[[1]] )) ) # FALSE Rui Barradas Em 18-08-2012 16:16, Joshua Ulrich escreveu: I don't know

[Rd] Windows 7 and .libPaths()

2012-08-06 Thread Rui Barradas
loaded via a namespace (and not attached): [1] fortunes_1.5-0 Rui Barradas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Windows 7 and .libPaths()

2012-08-06 Thread Rui Barradas
, your tip solved the problem. Rui Barradas Em 06-08-2012 13:12, Duncan Murdoch escreveu: On 12-08-06 6:09 AM, Rui Barradas wrote: Hello, I'm having some trouble trying to set the .libPaths() on Windows 7, R-2.15.0 and R-2.15.1. The environment variables R_LIBS and R_LIBS_USER are set according

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Rui Barradas
before zero as last digit of the year, then the 10th is '0' as (now) expected, then goes to the second digit, etc. It seems to stop at the first 9, or else we would have some sort of real problem. Anyway, this doesn't look right. Rui Barradas Em 10-07-2012 22:17, Winston Chang escreveu

Re: [Rd] Negative years with strptime?

2012-07-10 Thread Rui Barradas
=Portuguese_Portugal.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base Rui Barradas Em 11-07-2012 02:05, Winston Chang escreveu: It looks different on my system (Mac, R 2.15.1) seq(as.Date(-01-01), length = 22, by = -1 year) [1] -01-01 -001-01-01 -002-01

Re: [Rd] How to create data frame column name in a function

2012-05-03 Thread Rui Barradas
=) DF[index, cname] - value See ?[-.data.frame (And df is the name of an R function, use something else, it can be confusing.) Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-data-frame-column-name-in-a-function-tp4605358p4605939.html