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 compare

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

2024-05-13 Thread Duncan Murdoch
ame 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 suggestions on usin

Re: [R] Strange variable names in factor regression

2024-05-09 Thread Duncan Murdoch
nings. 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.frame(date

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

2024-05-08 Thread Duncan Murdoch
() 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@r-project

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 relevant. Dunc

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

2024-05-01 Thread Duncan Murdoch
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 the posting guide http://www.R-project.org

Re: [R] any and all

2024-04-12 Thread Duncan Murdoch
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)), any(!is.na(secon

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

2024-04-12 Thread Duncan Murdoch
wser())) [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 be a list to dr

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 call to one

Re: [R] Regexp pattern but fixed replacement?

2024-04-11 Thread Duncan Murdoch
sub-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) Duncan Murdoch

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
on the 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 Subject: Re

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 on my insta

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 runnin

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/CloudStorage

Re: [R] Building Packages.

2024-03-20 Thread Duncan Murdoch
ppens 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 Ben Bolke

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

2024-03-05 Thread Duncan Murdoch
imits 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
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". So,

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

2024-02-14 Thread Duncan Murdoch
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 ignore your bug report? Duncan Murdoch __

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
on'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.ethz.ch/mail

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

2024-02-13 Thread Duncan Murdoch
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 writing it her

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

2024-02-13 Thread Duncan Murdoch
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 (https

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
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 Rterm in Windows. Iago

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

2024-01-30 Thread Duncan Murdoch
ld 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 Murdoch On

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

2024-01-30 Thread Duncan Murdoch
gh 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 http://www.R

Re: [R] DescTools::Quantile

2024-01-27 Thread Duncan Murdoch
:k] + 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 __ R-help@r-proj

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 decide

[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

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
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 Murdoch _

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Duncan Murdoch
ic 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 Skarbiniks Pedersen Date: Thursday, December 14, 2023 at 6:42 

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Duncan Murdoch
(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 those. There are

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

2023-12-08 Thread Duncan Murdoch
rks, 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 Research, Education

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

2023-12-02 Thread Duncan Murdoch
foot{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, it se

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/listinfo/r-

Re: [R] Code editor for writing R code

2023-11-29 Thread Duncan Murdoch
(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 Sergei

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: at https

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; details

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

2023-10-29 Thread Duncan Murdoch
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 at least 20 years! Dunc

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

2023-10-28 Thread Duncan Murdoch
be. 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 Jeff

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

2023-10-28 Thread Duncan Murdoch
e 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
<- 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 and more, see https://stat.ethz.ch/mailman/listinfo/

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 the id

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/2023 3:2

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

2023-10-22 Thread Duncan Murdoch
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. Best

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

2023-10-15 Thread Duncan Murdoch
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 __ R-help@r

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 may be t

Re: [R] Odd result

2023-09-24 Thread Duncan Murdoch
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 UNSUBSCRIBE and m

Re: [R] How to import an excel data file

2023-09-23 Thread Duncan Murdoch
file paths. file.choose() exists on all platforms. choose.files() only exists on Windows. 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] halting with errors

2023-09-18 Thread Duncan Murdoch
You can use try() or tryCatch(). The former is simpler, the latter is more flexible. For example: result <-

Re: [R] Merge and replace data

2023-09-05 Thread Duncan Murdoch
s smaller than the x2 value: then you would use ifelse(x1 != 0, x1, x2) Similarly ifelse(x2 != 0, x2, x1) would prefer the x2 value. You should think about what you would do in these other cases as well. Duncan Murdoch __ R-help@r-project.or

Re: [R] [Pkg-Collaboratos] BioShapes Almost-Package

2023-09-04 Thread Duncan Murdoch
you'll lose all your edits. But this is a good way to get started. I think for the first few times the comments are really helpful, but I wouldn't mind a way to suppress them. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Problems with installing R packages from source and running C++ in R, even on fresh R installation

2023-08-30 Thread Duncan Murdoch
e old days it was set in the System app in the Windows Control Panel under "Edit the system environment variables". I don't know if that's still true. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://

Re: [R] Error "STRING_ELT() can only be applied to a 'character vector', not a 'list'" from rmarkdown

2023-08-24 Thread Duncan Murdoch
use trace() to identify which call causes problems (increment and print a counter on each call), then break just before the bad call and try to see what went wrong. Duncan Murdoch It's the same if I do it in Rstudio or from the command line like that so I think I can safely say it's not an Rs

Re: [R] Error "STRING_ELT() can only be applied to a 'character vector', not a 'list'" from rmarkdown

2023-08-24 Thread Duncan Murdoch
Could you post a link to the source for that Rmd file? Duncan Murdoch On 24/08/2023 1:58 p.m., Chris Evans via R-help wrote: I have an Rmarkdown file which is part of my distill "Rblog" (https://www.psyctc.org/Rblog/).  It was knitting fine until last week, now knitting

Re: [R] col2rgb() function

2023-07-23 Thread Duncan Murdoch
),pch=19,cex=2)* gives me a reddish dot, but not the same as in the colour-blind palette Why are you dividing by 307? You should divide by 255. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.

Re: [R] Line Directives in Sweave Document

2023-06-28 Thread Duncan Murdoch
so that it isn't a syntax error, i.e. #\u200Bline 1 "file1.R" or if that shows the escape, print that string and copy the actual character into your document. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] warnng to an error....

2023-06-17 Thread Duncan Murdoch
2-1-in-coercion-to-logical1) but I am on a ubuntu22.04 machine with R 4.3.0. What should I do? Change it to: if((class(x)[1] == "xts") || (class(x)[2] == "zoo")) {code}... Changing it to `if (inherits(x, c("xts", "zoo")))` should d

Re: [R] Why install.packages(repos = X) does not override the 'repos' R option?

2023-06-15 Thread Duncan Murdoch
(Sorry, forgot "Reply all" last time.) That's an RStudio bug. It doesn't happen if you use install.packages() from R. Duncan Murdoch On 14/06/2023 9:22 a.m., Dean Attali wrote: There is a default R option for which repos to install from - `getOption("repos")`. When

[R] Plotting directly to memory?

2023-05-28 Thread Duncan Murdoch
to do this only for plotting text, i.e. I'd like to rasterize some text into an array. 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 gu

Re: [R] environments: functions within functions

2023-05-26 Thread Duncan Murdoch
I agree with Iris: the switch() solution looks like the best option here. The only change I'd make is to pass the dots down to the print function (or possibly warn about using them if those functions don't support any other parameters). Duncan Murdoch On 25/05/2023 8:20 p.m., Iris Simmons

Re: [R] environments: functions within functions

2023-05-25 Thread Duncan Murdoch
e of the variable that is passed to print(). You could hide that fact by making a local function to do it, e.g. myprint <- function(x) print(x) and then calling myprint(fit1). Duncan Murdoch library(mixR) # first example from ?mixfit ## fitting the normal mixture models set.seed(103) x <

Re: [R] rgl not plotting properly

2023-05-05 Thread Duncan Murdoch
On 05/05/2023 7:41 a.m., Jiayue Wang wrote: 在 5/5/23 19:15, Duncan Murdoch 写道: On 05/05/2023 6:48 a.m., Jiayue Wang wrote: Thanks Duncan. glxgears works at the terminal; tcltk::tktoplevel() outputs the following: $ID [1] ".1" $env attr(,"class") [1] "tkwin"

Re: [R] rgl not plotting properly

2023-05-05 Thread Duncan Murdoch
your DISPLAY variable. Does Sys.getenv("DISPLAY") show the same thing in R as you see when printing that environment variable (using e.g. `echo $DISPLAY`) in the terminal? Duncan Murdoch 在 5/5/23 16:45, Duncan Murdoch 写道: On 05/05/2023 2:24 a.m., Jiayue Wang wrote: Hi I can't

Re: [R] rgl not plotting properly

2023-05-05 Thread Duncan Murdoch
running "glxgears" at the terminal, and try running "tcltk::tktoplevel()" in R. BTW, this list isn't for contributed package support, so if it turns out that only rgl is failing, it may be best to move the discussion to https://github.com

Re: [R] question about update()

2023-05-04 Thread Duncan Murdoch
On 04/05/2023 4:34 a.m., Adelchi Azzalini wrote: On 4 May 2023, at 10:26, Duncan Murdoch wrote: On 04/05/2023 4:05 a.m., Adelchi Azzalini via R-help wrote: Hi. There must be something about the use of update() which I do not grasp, as the next exercise indicates. Suppose that obj

Re: [R] grDevices::hcl.colors using two colours: Bug or Feature?

2023-04-28 Thread Duncan Murdoch
ouldn't spot any other places that would need fixing. Duncan Murdoch Will have a closer look... Thanks for reporting this! Achim On Fri, 28 Apr 2023, Rui Barradas wrote: Às 06:01 de 28/04/2023, Stevie Pederson escreveu: Hi, I'm not sure if this is a bug or a feature, but after updating to R

Re: [R] grDevices::hcl.colors using two colours: Bug or Feature?

2023-04-28 Thread Duncan Murdoch
This is a 4.3.0 reversion. I'm seeing it as well on R version 4.3.0 RC (2023-04-13 r84266) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.6.5 Duncan Murdoch On 28/04/2023 5:51 a.m., Rui Barradas wrote: Às 06:01 de 28/04/2023, Stevie Pederson escreveu: Hi

Re: [R] Plot R graphs in aws

2023-04-20 Thread Duncan Murdoch
there (as long as it is running on a Unix-alike). 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

Re: [R] Package Caret

2023-04-14 Thread Duncan Murdoch
You should post the result of running sessionInfo(), and tell us how you installed R. Your installation seems very broken. Duncan Murdoch On 14/04/2023 3:45 a.m., Gábor Malomsoki wrote: This is the error then: error in prettyseq(1:ncol(out)) : could not find function "prettyseq"

Re: [R] aborting the execution of a script...

2023-04-12 Thread Duncan Murdoch
                         What if I use source() with echo? I am using that in RStudio. THanking you, Yours sincerely AKSHAY M KULKARNI -------- *From:* Duncan Murdoch *Sent:* Wednesday, April 12, 2023 5:35 PM *To:* akshay kulkarni ; R

Re: [R] aborting the execution of a script...

2023-04-12 Thread Duncan Murdoch
) print(2) then execution stops at the "stop" line if I use source(), or R CMD BATCH , or in RStudio, Run or Source gives the same behaviour. I think older versions of RStudio would have run all three lines using Run, but all the other methods have stopped at the stop() li

Re: [R] R does not run under latest RStudio

2023-04-06 Thread Duncan Murdoch
, or just stay with the old RStudio version that was working for you. 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

Re: [R] on lexical scoping....

2023-04-05 Thread Duncan Murdoch
It seems mostly correct. Here are a few quibbles: - I don't think "owner" is a good description of the parent environment. Usually when I use owner in computing, there's an implication that the owner controls what it owns, is responsible for allocating and destroying it, etc. Parent

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
verse" packages. There are a lot of really good ideas in those packages, but "tidy evaluation" is far too complicated and hard to understand, and I think it confuses people, so they don't understand the really very simple R scoping rules. Duncan Murdoch On 04/04/2023 10:59 a

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
t; and "frame" arguments, and always use "envir" if you want to say where to look. Duncan Murdoch On 04/04/2023 10:28 a.m., akshay kulkarni wrote: Dear Deepayan, THanks for the pithy, pointed reply. But isn't it risky? Can I somehow get a warnin

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
.1.10 in that manual for how R looks up variables. Duncan Murdoch THanking you, Yours sincerely, AKSHAY M KULKARNI ---- *From:* Duncan Murdoch *Sent:* Tuesday, April 4, 2023 7:48 PM *To:* akshay kulkarni ; R help Mailing list

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
list (i.e. not "attached" because you never called library() or require() on them), because they just aren't in the chain of environments where R looks. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://s

Re: [R] weird things in seqMK() and sqmk()

2023-04-01 Thread Duncan Murdoch
, though sometimes knowledgeable people here will comment. Duncan Murdoch On 01/04/2023 2:05 p.m., Nick Wray wrote: Hello The other say I posted a question about altering confidence limits in the seqMK() function in the pheno package. I didn't get any bites but in any case I've been trying to use

Re: [R] Displaying Dichotomous Variables as fractions in gtsummary Tables

2023-03-27 Thread Duncan Murdoch
I think questions about gtsummary are better addressed to that project. They have a link "Getting Help" on their web page; I'd start there: https://www.danieldsjoberg.com/gtsummary/SUPPORT.html Duncan Murdoch On 27/03/2023 2:19 p.m., Deramus, Thomas Patrick wrote: Hi R Experts.

Re: [R] printing a data.frame without row numbers

2023-03-27 Thread Duncan Murdoch
print(data.frame(COL1=1:5, COL2=10:6), row.names=FALSE) On 27/03/2023 1:05 p.m., Dennis Fisher wrote: R 4.2.3 OS X Colleagues, I am printing a large number of tables using the print command. A simple example is: print(data.frame(COL1=1:5, COL2=10:6)) The result in this case is:

Re: [R] Rprofile.site and automatic installation of missing packages

2023-03-21 Thread Duncan Murdoch
MASS should be loaded but is not search() [1] ".GlobalEnv""package:stats" "package:graphics" "package:grDevices" "package:utils" "package:datasets" "package:methods" "Autoloads" &quo

Re: [R] Rprofile.site and automatic installation of missing packages

2023-03-21 Thread Duncan Murdoch
and utils::install.packages . Duncan Murdoch On 21/03/2023 8:04 a.m., PIKAL Petr wrote: Dear all. I am trying to install missing (not installed) packages during startup of R through code in Rprofile.site but I miserably failed and I am not sure what I am doing wrong. R is installed to

Re: [R] lexical scoping for scripts......

2023-03-19 Thread Duncan Murdoch
BATCH run, not some other session that may be running in another process. Sorry for the confusion. Duncan Murdoch THanking you, Yours sincerely, AKSHAY M KULKARNI ---- *From:* Duncan Murdoch *Sent:* Monday, March 20, 202

Re: [R] lexical scoping for scripts......

2023-03-19 Thread Duncan Murdoch
various functions (save(), save.image(), saveRDS(), writeLines(), etc.) to write them to disk if you don't want them to disappear. Duncan Murdoch THanking you, yours sincerely, AKSHAY M KULKARNI *From:* Duncan Murdoch

Re: [R] lexical scoping for scripts......

2023-03-18 Thread Duncan Murdoch
e("f.R", local = e) Then you'll find that x retains the value 456, and e$f() returns 123. Does the same apply for running the same script from the system command line by R CMD BATCH? I don't think R CMD BATCH has any equivalent to the local argument. Everything is evaluated i

Re: [R] null in rao.test in R

2023-03-11 Thread Duncan Murdoch
s. What this indicates to me is that the test as implemented is unable to detect directions that differ by pi. I don't know whether the original test had this limitation or whether it isn't implemented as designed. Duncan Murdoch __ R-help@r-project.or

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Duncan Murdoch
On 23/02/2023 6:09 a.m., Achim Zeileis wrote: Duncan, thanks for your feedback. I just received your response after sending out mine. You came to the same conclusion. Should I prepare a patch and send it to you so that you can also have a look? Or view Bugzilla? Copying Sigbert's message to

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Duncan Murdoch
the same sort of approach would fix cm.colors and topo.colors. 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/post

Re: [R] Extracting data using subset function

2023-02-05 Thread Duncan Murdoch
ngth 0, it's a good habit to get into so that in the future you don't get surprised. 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://

Re: [R] Detpack package

2023-02-01 Thread Duncan Murdoch
forgot to export it. You can see the source of the version on CRAN here: https://github.com/cran/detpack The author used Roxygen2, but apparently forgot to say @export before that function (and some others). The package tests perfectly OK on CRAN, because n

Re: [R] dyn.load(now = FALSE) not actually lazy?

2023-02-01 Thread Duncan Murdoch
that can't be resolved. And there's that last sentence. I think for what you want, you'd have to write the DLL (i.e. libtorch) in such a way that it does delayed loading of its dependencies. Duncan Murdoch On 31/01/2023 10:16 p.m., Michael Milton wrote: On Linux, if I have a .so fil

Re: [R] Bug in internal 'tar' implementation?

2023-01-31 Thread Duncan Murdoch
Or directly to bugs.r-project.org . It definitely looks to me like a bug. Instructions for bug reports are here: https://www.r-project.org/bugs.html . David might need to set up a Bugzilla account according to those instructions before reporting. Duncan Murdoch On 31/01/2023 1:40 p.m

Re: [R] akima interp results to zero with less than 10 values

2023-01-26 Thread Duncan Murdoch
The akima package has a problematic license (it doesn't allow commercial use), so it's been recommended that people use the interp package instead. When I use interp::interp instead of akima::interp, I get reasonable output from your example. So that's another reason to drop akima... Duncan

Re: [R] Minimal match to regexp?

2023-01-26 Thread Duncan Murdoch
(pattern2, x)), width = 10) ``` you can see that it does find the match, so the combination of *? and \\1 must be messing up regexpr(). They seem to work perfectly fine on their own. On Wed, Jan 25, 2023 at 7:57 PM Duncan Murdoch wrote: Thanks for pointing out my mistake. I oversimplified

  1   2   3   4   5   6   7   8   9   10   >