Re: [R] Looking for simple line-splitting code

2025-02-05 Thread Duncan Murdoch
On 2025-02-05 5:20 p.m., Rolf Turner wrote: On Wed, 5 Feb 2025 08:44:12 -0500 Duncan Murdoch 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 lin

Re: [R] Looking for simple line-splitting code

2025-02-05 Thread Duncan Murdoch
strsplit(paste(x,collapse="\n"),"\n")[[1]] [1] "abc" "def" """ghi" On 5 Feb 2025, at 14:44 , Duncan Murdoch wrote: If I have this object: x <- c("abc\ndef", "", "ghi") and I write it to a file

[R] Looking for simple line-splitting code

2025-02-05 Thread Duncan Murdoch
nd reading it. My first attempt doesn't work: unlist(strsplit(x, "\n")) because it leaves out the blank line 3. I can fix that with this ugly code: lines <- strsplit(x, "\n") lines[sapply(lines, length) == 0] <- list(""

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Duncan Murdoch
d it will satisfy the check code. Duncan Murdoch R CMD check say “no visible binding for global variable ‘date’” Sent from my iPhone On Jan 28, 2025, at 1:24 AM, Sorkin, John wrote:  There you go, once again helping strengthen ;) John Get Outlook for iOS<https://aka.ms/o0ukef> ___

Re: [R] Interpreting the output of str on a data frame created using aggregate function

2025-01-24 Thread Duncan Murdoch
the column names. (D) Does it mean that the dimensions of the matrix are stored as two separate lists? No. The dim is an attribute which is shown implicitly as "[1:844, 1:7]", i.e. c(844, 7). Duncan Murdoch (E) If so, how do I access the lists? When I enter dimnames(mar

Re: [R] [External] Re: Parser For Line Number Tracing

2025-01-21 Thread Duncan Murdoch
fixes, especially if my patch is incorporated. Duncan Murdoch On 2025-01-20 5:56 p.m., Duncan Murdoch wrote: I've posted a patch to bugs.r-project.org that fixes the traceback() issue. It's not specific to findFun3; you get the same problem with errors from expressions like

Re: [R] [External] Re: Parser For Line Number Tracing

2025-01-20 Thread Duncan Murdoch
I'll try to track down a reproducible case, and perhaps a patch to fix it. Duncan Murdoch On 2025-01-20 9:37 a.m., Duncan Murdoch wrote: Sorry, I'm not seeing the first problem now: options(show.error.locations = TRUE) works fine. Not sure what I did wrong before. I'm still se

Re: [R] [External] Re: Parser For Line Number Tracing

2025-01-20 Thread Duncan Murdoch
ailed call. Perhaps findFun3 could set up a fake context so that traceback() adds one more entry? Duncan Murdoch On 2025-01-19 3:39 p.m., Duncan Murdoch wrote: Thanks for pointing out the options. Using options(show.error.locations = TRUE) works on Ivo's example, but it doesn't sh

Re: [R] [External] Re: Parser For Line Number Tracing

2025-01-19 Thread Duncan Murdoch
ions(). In particular you may want to look at entries in ?options for show.error.locations showErrorCalls showWarningCalls and adjust your options settings accordingly. Best, luke Regards, /ivo On Sun, Jan 19, 2025 at 2:39 AM Duncan Murdoch wrote: On 2025-01-18 8:27 p.m., Ivo Welch wrote:

Re: [R] Parser For Line Number Tracing

2025-01-19 Thread Duncan Murdoch
he last line by default *every time* a script dies. Most computer languages do so. Should I file it as a request for improvement to the R code development team? Maybe R can be improved at a very low cost to the development team and a very high benefit to newbies. Regards, /ivo On Sun, Jan

Re: [R] Parser For Line Number Tracing

2025-01-19 Thread Duncan Murdoch
> source("test.R") Current call stack locations: . . . . test.R#4 test.R#2 Error in nofunction("something stupid I am doing!") : could not find function "nofunction" Current call stack locations: . . . . test.R#6 The first report is from the explicit call in

Re: [R] Parser For Line Number Tracing

2025-01-18 Thread Duncan Murdoch
This all depends on calling source() with parameter keep.source = TRUE. The default value of that parameter is getOption("keep.source"), so if you're not seeing the line numbers, you may have set that option to FALSE. Duncan Murdoch __ R-he

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Duncan Murdoch
ends are allowed to replace the underlying function, so that may depend on which front end you are using. I'm talking about R.app on a Mac. Duncan Murdoch On 2024-12-18 10:32 a.m., J C Nash wrote: I've been working on a small personal project that needs to select files for manipul

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Duncan Murdoch
so have many local optima, though I don't know in this case. Duncan Murdoch Best, John On Sat, 14 Dec 2024 at 01:14, John Fox wrote: Dear Daniel et al., Following on Duncan's remark and examining the message produced by nloptr(), I simply tried increasing the max

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Duncan Murdoch
You posted a version of this question on StackOverflow, and were given advice there that you ignored. nloptr() clearly indicates that it is quitting without reaching an optimum, but you are hiding that message. Don't do that. Duncan Murdoch On 2024-12-13 12:52 p.m., Daniel Lobo

Re: [R] outer() is not working with my simple function

2024-12-10 Thread Duncan Murdoch
your function could be FN1 <- function(x, y) rep_len(3, length(x)) and it would work. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] Undocumented behaviour of diag when replacing the diagonal of a matrix?

2024-12-04 Thread Duncan Murdoch
(A[-1, ]) <- 2` is pretty complex; it involves two assignment functions (both `diag<-` and `[<-`), so you might have tried to execute the wrong thing. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] Remove all box around a plot except bottom line (base graphics)

2024-11-29 Thread Duncan Murdoch
d 4 right sides of the plot box) You don't need the axis() call. plot() already includes the x axis. Duncan Murdoch Best Fer On 11/28/24 14:52, Duncan Murdoch wrote: On 2024-11-28 8:36 a.m., Michael Dewey wrote: To make the plot clearer I have removed the axes but I wish to remove al

Re: [R] Remove all box around a plot except bottom line (base graphics)

2024-11-28 Thread Duncan Murdoch
egments(). For example: plot(rnorm(100), yaxt="n", bty="n") usr <- par("usr") lines(usr[c(1,2)], usr[c(3,3)], xpd = TRUE) You might not even need the lines() call if you don't care how far the axis extends. Duncan Murdoch ___

Re: [R] grDevices::bringToTop is documented but not available: A bug?

2024-11-21 Thread Duncan Murdoch
tions have the same issue as ?bringToTop. Maybe someone remembers the intention of that move... Duncan Murdoch On 2024-11-20 1:09 p.m., re...@meer.net wrote: There is help for grDevices::bringToTop but the function is not present. bringToTop() Error in bringToTop() : could not find fun

Re: [R] Invalid term in model formula with gmm after formula.tools is loaded

2024-11-04 Thread Duncan Murdoch
dn't have time to fix the bug. Apparently nobody else has had time either. Another choice is to recognize that there isn't much interest in supporting that package from the author or any of its users, and abandon it. Duncan Murdoch __ R-he

Re: [R] Help in Recursive Function for steps reconstruction in Clusters Analysis - HCA: Single Link

2024-10-26 Thread Duncan Murdoch
nd( xmd1, xmd2 ) ) ) There may be other places where this change is needed; I haven't tried running your code. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] OSX-specific Bug in randomForest

2024-10-23 Thread Duncan Murdoch
I've cc'd this to the package maintainer, Andy Liaw . I'm not sure he reads this list. Duncan Murdoch On 2024-10-23 1:26 a.m., Stevie Pederson wrote: Hi, It appears there is an OSX-specific bug in the function `randomForest.default()` Going by the source code at https://

Re: [R] Is there a sexy way ...?

2024-09-27 Thread Duncan Murdoch
sult. However I cannot devise one. Don't you find a for loop's naked display of intention to be sexy? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-13 Thread Duncan Murdoch
On 2024-09-13 8:53 a.m., Jonathan Dushoff wrote: Message: 4 Date: Thu, 12 Sep 2024 11:21:02 -0400 From: Duncan Murdoch That's not the correct formula, is it? I think the result should be x * Conj(y) / Mod(y)^2 . Correct, sorry. And thanks. So that would involve * and / , not just

Re: [R] Subject: Re: BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-12 Thread Duncan Murdoch
gets opened up – it might also make sense to calculate x / y using real arithmetic (as x*y / |y|²) That's not the correct formula, is it? I think the result should be x * Conj(y) / Mod(y)^2 . So that would involve * and / , not just real arithmetic. Dunc

Re: [R] Reading a txt file from internet

2024-09-08 Thread Duncan Murdoch
spec says to honor the BOM and if there isn't one to assume that it is big-endian data. But in this case there is a BOM so your machine has a buggy decoder? Sounds like it! I did it on a Mac running R 4.4.1. Duncan Murdoch On September 7, 2024 2:43:24 PM PDT, Duncan Murdoch wrote: On

Re: [R] Reading a txt file from internet

2024-09-07 Thread Duncan Murdoch
On 2024-09-07 4:52 p.m., Jeff Newmiller via R-help wrote: When you specify LE in the encoding type, you are logically telling the decoder that you know the two-byte pairs are in little-endian order... which could override whatever the byte-order-mark was indicating. If the BOM indicated big-en

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-06 Thread Duncan Murdoch
flaws need thinking about, and sometimes shouldn't be fixed. On the other hand, I was unable to find documentation saying that the current behaviour is intended, so I could be wrong. Duncan Murdoch On Fri, 6 Sept 2024 at 10:12, Bert Gunter wrote: Perhaps Inf*1i [1] NaN+Infi clarifies wh

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Duncan Murdoch
CxByReal(complex(real=0, imaginary=Inf), 5) # [1] 0+Infi Duncan Murdoch Sincerely, Leonard -------- *From:* Duncan Murdoch *Sent:* Friday, September 6, 2024 12:40 AM *To:* Leo Mada ; r-help@r-project.org *Subject:* Re: [R] BUG:

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Duncan Murdoch
ink this is a bug? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented,

Re: [R] Terminating a cmd windows from R

2024-08-17 Thread Duncan Murdoch
ell window. Could you show us an example of what you are doing? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.o

Re: [R] Very strange behavior of 'rep'

2024-08-15 Thread Duncan Murdoch
1, each=n.per.grp*n.tt)) #> [1] 1078 Duncan Murdoch Created on 2024-08-15 with [reprex v2.1.1](https://reprex.tidyverse.org) On 2024-08-15 2:39 p.m., Izmirlian, Grant (NIH/NCI) [E] via R-help wrote: \n<>\n\n \n<< This is very weird. I was running a swarm job on the cluster and it b

Re: [R] Determining the Correct Help List

2024-08-12 Thread Duncan Murdoch
rgl is probably not appropriate on any of the R mailing lists. You could post as an issue on its Github page, or as a question on StackOverflow. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] If loop

2024-08-09 Thread Duncan Murdoch
equired to be an existing variable in a parent environment. Duncan Murdoch -- Bert On Fri, Aug 9, 2024 at 1:53 AM CALUM POLWART wrote: OK. The fact it's in a function is making things clearer. Are you trying to update the values of an object from within the function, and hav

Re: [R] Manually calculating values from aov() result

2024-08-07 Thread Duncan Murdoch
Sure, summary(aov(A ~ C, dat)) will give it to you. Duncan Murdoch On 2024-08-07 8:27 a.m., Brian Smith wrote: Hi, Thanks for this information. Is there any way to force R to use Type-1 SS? I think most textbooks use this only. Thanks and regards, On Wed, 7 Aug 2024 at 17:00, Duncan Murdoch

Re: [R] Manually calculating values from aov() result

2024-08-07 Thread Duncan Murdoch
On 2024-08-07 6:06 a.m., Brian Smith wrote: Hi, I have performed ANOVA as below dat = data.frame( 'A' = c(-0.3960025, -0.3492880, -1.5893792, -1.4579074, -4.9214873, -0.8575018, -2.5551363, -0.9366557, -1.4307489, -0.3943704), 'B' = c(2,1,2,2,1,2,2,2,2,2), 'C' = c(0,1,1,1,1,1,1,0,1,1)) summary

Re: [R] round and trailing zero

2024-07-29 Thread Duncan Murdoch
ad only one element per column. If you had printed t(haz) you'd get numbers displayed like the second version, where haz[1,] converts that row to a vector. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see http

Re: [R] Using the pipe, |>, syntax with "names<-"

2024-07-20 Thread Duncan Murdoch
On 2024-07-20 6:02 p.m., Iris Simmons wrote: z <- data.frame(a = 1:3, b = letters[1:3]) z |> names() |> _[2] <- "foo" z That's a great suggestion! Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSU

Re: [R] Using the pipe, |>, syntax with "names<-"

2024-07-20 Thread Duncan Murdoch
I suspect that you would want to define a function which was aware of the limitations of piping to handle this. For example: rename <- function(x, col, newname) { names(x)[col] <- newname x } Then z |> rename(2, "foo") would be fine. Duncan Murdoch On 2024-07-20 4:4

Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-05 Thread Duncan Murdoch
e first place. So if you’re as clever as you can be when you write it, how will you ever debug it?" Duncan Murdoch On 2024-07-05 7:35 a.m., Erez Shomron wrote: Is the following a bug in your opinion? I think so. This works as expected: ``` with(mtcars, plot(wt, mpg, plot.first = { plo

Re: [R] plot(aov, which=1) with different labels?

2024-06-20 Thread Duncan Murdoch
your help Plotting an aov object is done by stats:::plot.lm. From the help page ?plot.lm, I think the value that you want to change is the "caption" argument, i.e. plot(my_aov, which=1, ann=FALSE, caption = "Résidus vs Valeurs prédites") title(xlab="Valeur

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Duncan Murdoch
ith line breaks. This works: 1:10 |> mean() but this fails: 1:10 |> mean() Duncan Murdoch If you don't want to do that, install and load the 'magrittr' package and change |> to %>% everywhere. On 2024-06-18 12:13 p.m., Ogbos Okike wrote: Greetings

Re: [R] Format

2024-06-09 Thread Duncan Murdoch
aren't legal months in the first entry. Your format looks like it should be "%d/%m/%y". Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] What is the HEX code for "transparent" color?

2024-06-06 Thread Duncan Murdoch
e context. Not all graphics functions in R can handle transparency, so please show us some reproducible code for what you are trying. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listin

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Duncan Murdoch
eople I have at the intersection of the three. It depends on how those are stored. Could you put together a little dataframe containing sample data, run `dput()` on it, and post the result here? Duncan Murdoch __ R-help@r-project.org mailing list --

Re: [R] Current version of R, 4.4.0 and patch to correct the bug fix related to the RStudio viewer pane on Windows systems

2024-05-16 Thread Duncan Murdoch
, 2018 3.4.1: June, 2017 3.3.1: June, 2016 So it's a good guess that it will happen before September, and better than even odds it will be before July. Duncan Murdoch On 2024-05-16 7:39 a.m., Vega, Ann (she/her/hers) via R-help wrote: I help to coordinate the USEPA's R user group. We

Re: [R] test2r.mengz1(X)

2024-05-13 Thread Duncan Murdoch
Google says that function is in the bcdstats package, which isn't on CRAN. It appears to be a private package for a course, kept on Github. Duncan Murdoch On 2024-05-13 12:24 p.m., Alligand, Justine wrote: Dear participants and subscribers of the R-help mailing list, I would like to co

Re: [R] Is there some way to customize colours for the View output?

2024-05-13 Thread Duncan Murdoch
d in the same colour as the background of a dialog box, i.e. some kind of gray. I don't think R tries to control that colour, but perhaps some Windows setting would change it. Duncan Murdoch On 2024-05-13 4:50 a.m., Iago Giné Vázquez wrote: Hi all, I've just could test your

Re: [R] Strange variable names in factor regression

2024-05-09 Thread Duncan Murdoch
t meanings. It may also be a little bit of a surprise that you go back to treatment contrasts when you leave out the intercept with the ordered factor, but then it almost never makes sense to leave out the intercept in a polynomial fit. Duncan Murdoch Thanks, Naresh mydf <- data.f

Re: [R] losing variable attributes when subsetting model.frame

2024-05-08 Thread Duncan Murdoch
NextMethod() attr(subset, "vi") <- attr(x, "vi") subset } x<- 1:5 z<-runif(5) y<-rnorm(5) mf <- model.frame(y~f(z), subset=x>=3) attr(mf[,2],"vi") #it works #> [1] 5 Duncan Murdoch __ R-help

Re: [R] Is there some way to customize colours for the View output?

2024-05-07 Thread Duncan Murdoch
On 07/05/2024 6:31 a.m., Iago Giné Vázquez wrote: Thanks Duncan. I am currently on Windows. Is there any solution for it? Switch to Linux or MacOS? Duncan Murdoch Best regards, Iago *De:* Duncan Murdoch *Enviat el

Re: [R] Is there some way to customize colours for the View output?

2024-05-07 Thread Duncan Murdoch
platforms. Colour names (used for foreground and background) can be words or hex colors like #ff . I don't know the format for "geometry", but I'd guess it's like the -geometry argument to X11 apps, e.g. 1000x1000+0+0. If you are on Windows, none of this is rele

Re: [R] strange behavior in base::as.double

2024-05-01 Thread Duncan Murdoch
.e. 123e0. That is no longer true after the recent fix; I'm not sure if it is in R 4.4.0-patched yet. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] any and all

2024-04-12 Thread Duncan Murdoch
eally help you without a reproducible example. It's not enough to show us something that doesn't run but is a bit like the real code. Duncan Murdoch result <- filter(mydata, all( any(!is.na(first.a), !is.na(first.b)), a

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Duncan Murdoch
er = quote(browser())) [1] "f" > body(f) { g <- function() { { .doTrace(browser(), "step 2,3,3,2") print("this is g") } } print("this is f") g() } Note that the "at" argument needs to b

Re: [R] Regexp pattern but fixed replacement?

2024-04-11 Thread Duncan Murdoch
you'll be good to go. Thanks, that's what I've done. Duncan Murdoch On Thu, Apr 11, 2024, 12:36 Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> wrote: I noticed this issue in stringr::str_replace, but it also affects sub() in base R. If the pattern in a

Re: [R] Regexp pattern but fixed replacement?

2024-04-11 Thread Duncan Murdoch
-like function with a way to declare the pattern as a regexp, but the replacement as fixed. Thanks for your answer to my second question. Duncan Murdoch The string that is output is an R string: the backslashes are escaped with a backslash, so "" really means two backslashes.

[R] Regexp pattern but fixed replacement?

2024-04-11 Thread Duncan Murdoch
lace which allows the pattern to be declared as a regular expression, but the replacement to be declared as fixed? 2. To get what I want, I can double the backslashes in the replacement text. This would do that: replacement <- gsub("", "\\\

Re: [R] split a factor into single elements

2024-03-28 Thread Duncan Murdoch
On 28/03/2024 7:48 a.m., Stefano Sofia wrote: as.factor(2024, 12, 1, 0, 0) That doesn't work. You need to put the numbers in a single vector as Fabio did, or you'll see this: Error in as.factor(2024, 12, 1, 0, 0) : unused arguments (12, 1, 0, 0) Dunc

Re: [R] Building Packages.

2024-03-21 Thread Duncan Murdoch
I posted a description of their changes this morning. Duncan Murdoch On 21/03/2024 11:37 a.m., avi.e.gr...@gmail.com wrote: With all this discussion, I shudder to ask this. I may have missed the answers but the discussion seems to have been about identifying and solving the problem rapidly

Re: [R] [External] Re: Building Packages. (fwd)

2024-03-21 Thread Duncan Murdoch
search list, though I don't see how. Duncan Murdoch On 21/03/2024 7:44 a.m., luke-tierney--- via R-help wrote: [forgot to copy to R-help so re-sending] -- Forwarded message -- Date: Thu, 21 Mar 2024 11:41:52 + From: luke-tier...@uiowa.edu To: Duncan Murdoch Subjec

Re: [R] Building Packages.

2024-03-21 Thread Duncan Murdoch
Yes, you're right. The version found in the search list entry for "package:utils" is the RStudio one; the ones found with two or three colons are the original. Duncan Murdoch On 21/03/2024 5:48 a.m., peter dalgaard wrote: Um, what's with the triple colon? At least o

Re: [R] Building Packages.

2024-03-21 Thread Duncan Murdoch
The good news for Jorgen (who may not be reading this thread any more) is that one can still be sure of getting the original install.packages() by using utils:::install.packages( ... ) with *three* colons, to get the internal (namespace) version of the function. Duncan Murdoch On 21

Re: [R] Building Packages.

2024-03-20 Thread Duncan Murdoch
On 20/03/2024 1:07 p.m., Duncan Murdoch wrote: On 20/03/2024 12:37 p.m., Ben Bolker wrote: Ivan, can you give more detail on this? I've heard this issue mentioned, but when I open RStudio and run find("install.packages") it returns "utils::install.packages", and r

Re: [R] Building Packages.

2024-03-20 Thread Duncan Murdoch
Is the source for your package online somewhere? Duncan Murdoch On 20/03/2024 1:00 p.m., Jorgen Harmse via R-help wrote: Thank you, but I think I was already using utils. Regards, Jorgen. environment(install.packages) utils::install.packages('/Users/jharmse/Library/CloudSt

Re: [R] Building Packages.

2024-03-20 Thread Duncan Murdoch
ss only happens on other OSs? On MacOS, I see this: > install.packages function (...) .rs.callAs(name, hook, original, ...) I get the same results as you from find(). I'm not sure what RStudio is doing to give a different value for the function than what find() sees. Duncan Murdoch

Re: [R] How to invert axis within defined range with ggplot2 scale_y_reverse?

2024-03-05 Thread Duncan Murdoch
ts should be `c(30,20)`. Duncan Murdoch __ R-help@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, m

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-16 Thread Duncan Murdoch
which will prompt you for each one. Duncan Murdoch On 16/02/2024 11:33 a.m., Philipp Schneider wrote: Hey everyone, Thanks for all the input. It's happening again. This time for the packages "DBI", "parallelly", "segmented", "survival", "V8&q

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-14 Thread Duncan Murdoch
this has been the case for quite a few years. I found out during teaching --- one of the few times, I use RStudio to use R... in another case where RStudio's install.packages() behaved differently than R's. I'm pretty sure this is reason for quite a bit of confusion... Did they

Re: [R] Skip jumps in curve

2024-02-13 Thread Duncan Murdoch
It should be pretty easy to generalize my version of the `plot.gamma()` function to a version of `curve()` with an extra `discontinuities` argument. Duncan Murdoch On 13/02/2024 1:44 p.m., Leo Mada wrote: Dear Duncan, Thank you very much for the response. I suspected that such an option has

Re: [R] Skip jumps in curve

2024-02-13 Thread Duncan Murdoch
you don't know where the discontinuities are, it would be much harder, because discontinuities can be hard to detect unless the jumps are really big. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.et

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-13 Thread Duncan Murdoch
If that shows the same problems as when called from BiocManager::install, show us the log of what happened. If not, it's a Bioconductor issue. Duncan Murdoch On 13/02/2024 5:07 a.m., gernop...@gmx.net wrote: Yes you're right that it started as an Bioconductor issue. The reason I am writin

[R] Packages sometimes don't update, but no error or warning is thrown

2024-02-13 Thread Duncan Murdoch
l and respects your choice. Duncan Murdoch On 13/02/2024 3:59 a.m., gernophil--- via R-help wrote: Hey everyone, this question is related to this (https://community.rstudio.com/t/packages-are-not-updating/166214/3), this (https://www.biostars.org/p/9586316/#9586323) and this (

Re: [R] Avoiding Delete key function as 'Quit R' in Rterm when there are no characters in cursor line

2024-02-09 Thread Duncan Murdoch
o maybe you can track down the issue, or someone else will try. Or maybe you'll just have to avoid triggering the bug (if it really is one). Duncan Murdoch On 09/02/2024 10:03 a.m., Iago Giné Vázquez wrote: Yes, indeed, I am talking about Rte

Re: [R] R interpreting numeric field as a boolean field

2024-01-30 Thread Duncan Murdoch
hould specify a vector of type names, with one entry per column. Allowable names are "skip", "guess", "logical", "numeric", "date", "text" or "list". You'll have to read the docs to find out what some of those do. Duncan Mu

Re: [R] R interpreting numeric field as a boolean field

2024-01-30 Thread Duncan Murdoch
though that's what you should do if read_excel() offers that as a possibility. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

Re: [R] DescTools::Quantile

2024-01-27 Thread Duncan Murdoch
] + ord * allq[-(1:k)] This bug was reported on the package website 6 months ago (https://github.com/AndriSignorell/DescTools/issues/123), and hasn't been addressed. I'd suggest the best action is to find a different package. Duncan Murdoch _

Re: [R] Fwd: Strange results : bootrstrp CIs

2024-01-14 Thread Duncan Murdoch
On 13/01/2024 8:58 p.m., Rolf Turner wrote: On Sat, 13 Jan 2024 17:59:16 -0500 Duncan Murdoch wrote: My guess is that one of the bootstrap samples had a different selection of countries, so factor(Country) had different levels, and that would really mess things up. You'll need to d

[R] Fwd: Strange results : bootrstrp CIs

2024-01-13 Thread Duncan Murdoch
Sorry, didn't cc this to the list. Forwarded Message Subject: Re: [R] Strange results : bootrstrp CIs Date: Sat, 13 Jan 2024 17:37:19 -0500 From: Duncan Murdoch To: varin sacha You can debug things like this by setting options(error = recover). That will drop int

Re: [R] Strange results : bootrstrp CIs

2024-01-13 Thread Duncan Murdoch
t;, "Austria", "Austria") Time=c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3) e=data.frame(Score, Country, Time) library(boot) func= function(data, idx) { coef(lm(Score~ Time + factor(Country)),data=data[idx,]) } B= boot(e, func, R=1000) boot.

Re: [R] Truncated plots

2024-01-09 Thread Duncan Murdoch
ured in lines of text; they are in the order bottom, left, top, right, with default value `c(5.1, 4.1, 4.1, 2.1)`. Perhaps she has set the 2nd entry to zero. I'm sure there's something similar in ggplot2 and other graphics systems, but I don't know what it would be. Duncan Murd

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Duncan Murdoch
ere the pairwise comparison is obvious, while the numeric conversion isn't. A simple one would be a list of string vectors of different lengths, where you want to sort lexicographically. Duncan Have fun with the remainder of the advent! Another Martin From: R-help on behalf of Martin Møller Skar

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Duncan Murdoch
- function(x, i) structure(unclass(x)[i], class="sizeclass") df[order(df$value),] All the "unclass()" calls are needed to avoid infinite recursion. For a more complex kind of object where you are extracting attributes to compare, you probably wouldn't need so many of thos

Re: [R] Convert character date time to R date-time variable.

2023-12-08 Thread Duncan Murdoch
Subsetting works, e.g. m[1,1] is a time, etc. Duncan Murdoch Best; David Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine, University of Maryland School of Medicine; Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Rese

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Duncan Murdoch
--- \cfoot{Page \thepage\ of \pageref{LastPage}} \addtocounter{page}{-1} \includepdf[pages={1-},pagecommand={\thispagestyle{fancy}}]{Rplots.pdf} This works regardless of the number of pages in Rplots.pdf. Duncan Murdoch On Sat, 2 Dec 2023, 22:35 , wrote: Having read all of the replies,

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Duncan Murdoch
le{fancy}}]{Rplots.pdf} It would make more sense to do this in a LaTeX document, but I'm not sure if Dennis knows LaTeX... Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listin

Re: [R] Code editor for writing R code

2023-11-29 Thread Duncan Murdoch
well (as I noted in my response.) The original question did ask for recommendations for a different editor. Duncan Murdoch Best, Eric On Wed, Nov 29, 2023 at 6:55 PM Christofer Bogaso wrote: Hi Sergei, Where can I find TeX Comments extension in VS Code? On Wed, Nov 29, 2023 at 9:34 PM S

Re: [R] anyone having trouble accesing CRAN?

2023-11-15 Thread Duncan Murdoch
Yes, they posted a message about this recently. There's some maintenance happening and CRAN will be unavailable for a while. I can't find that message, but I think it was 2 or 3 days of downtime. Duncan Murdoch On 15/11/2023 2:13 p.m., Christopher W. Ryan via R-help wrote:

Re: [R] Calling Emacs Lisp Code/Function from R

2023-11-10 Thread Duncan Murdoch
I'm not an Emacs user, but the ESS-help mailing list (see ess.r-project.org) might be able to help with this. Duncan Murdoch On 10/11/2023 3:43 a.m., Iris Simmons wrote: Hi, I'm using R in Emacs and I'm interested in programatically knowing the details of all opened buffers;

Re: [R] The argument 'eps.Pvalue' of `printCoefmat()`

2023-10-29 Thread Duncan Murdoch
o read the source to figure out that this argument is to be used by format.pval(). Maybe the description of 'eps.Pvalue' can be revised to refer users to the help page of format.pval()? That looks like an oversight by the author of the help page. It's been there for

Re: [R] [Tagged] Re: col.names in as.data.frame() ?

2023-10-28 Thread Duncan Murdoch
. Unless you wish to extend your criticism to the current version for its failure to adhere to your proscription. Dataframes have to have column names. The function isn't modifying the object any more than it has to. Duncan Murdoch Cheers, Bert On Sat, Oct 28, 2023 at 11:55 AM

Re: [R] col.names in as.data.frame() ?

2023-10-28 Thread Duncan Murdoch
an see any unnamed arguments are ignored completely. If you want to specify the column names in a single call, you'll need to put them in the matrix, e.g. as.data.frame( matrix(c( "gaggle", "geese", "dule", "doves", "wake&

Re: [R] Bug in print for data frames?

2023-10-26 Thread Duncan Murdoch
x <- tibble(A = 1, B = 2, C = 3) y <- tibble(A = 1) x$C <- y[1] x #> # A tibble: 1 × 3 #> A B C$A #> #> 1 1 2 1 Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE an

Re: [R] Error running gee function. I neither understand the error message, nor know what needs to be done the get the gee to run

2023-10-25 Thread Duncan Murdoch
Actually a better solution would be to make PID into a factor. They can always be coerced to a number, but will display with your meaningful labels. Duncan Murdoch On 25/10/2023 3:38 p.m., Duncan Murdoch wrote: I don't see it documented, but it appears that the gee() function assumes t

Re: [R] Error running gee function. I neither understand the error message, nor know what needs to be done the get the gee to run

2023-10-25 Thread Duncan Murdoch
I don't see it documented, but it appears that the gee() function assumes the id variable can be coerced to a number. Your ids are in PID, and are strings like "HIPS004", etc. Change that to "004" or a numeric 4 and the error goes away. Duncan Murdoch On 25/10/202

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread Duncan Murdoch
meone else would see the same error message. Duncan Murdoch -- Bert On Sun, Oct 22, 2023 at 1:36 PM varin sacha via R-help wrote: Dear R-experts, Here below my R code with an error message. Can somebody help me to fix this error? Really appreciate your help.

Re: [R] Plot to a device and examine the plot?

2023-10-15 Thread Duncan Murdoch
s that drew the plot using recordPlot() and redraw it using replayPlot() (which is essentially what dev.copy() does), but the format of the object saved by recordPlot() is not documented, and is subject to change with R version changes. Duncan Murdoch

Re: [R] Grouping by Date and showing count of failures by date

2023-09-30 Thread Duncan Murdoch
There's a package called "pivottabler" which exports PivotTable: http://pivottabler.org.uk/reference/PivotTable.html . Duncan Murdoch On 30/09/2023 7:11 a.m., John Kane wrote: To follow up on Rui Barradas's post, I do not think PivotTable is an R command. You ma

Re: [R] Odd result

2023-09-24 Thread Duncan Murdoch
it is an R dataframe, you can delete lines using negative indices. In this case use fixed <- KurtzData[-(47:nrow(KurtzData)), ] which will create a new dataframe with only rows 1 to 46. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSC

  1   2   3   4   5   6   7   8   9   10   >