Re: [R] refresh.console() function?

2024-03-13 Thread Deepayan Sarkar
Perhaps you mean https://search.r-project.org/R/refmans/utils/html/flush.console.html Best, Deepayan On Wed, 13 Mar, 2024, 8:59 pm Christofer Bogaso, < bogaso.christo...@gmail.com> wrote: > Hi, > > I run a lengthy for loop and I want to display loop status for each > step in my loop. > > I

Re: [R] refresh.console() function?

2024-03-13 Thread Enrico Schumann
On Wed, 13 Mar 2024, Christofer Bogaso writes: > Hi, > > I run a lengthy for loop and I want to display loop status for each > step in my loop. > > I previously heard of a R function namely refresh.console() which > would print the status within the loop as it progresses. > > However I see this >

Re: [R] [External] Function environments serialize to a lot of data until they don't

2024-03-11 Thread Ivan Krylov via R-help
Dear Luke, Thank you for the detailed explanation of the power of force()! It does solve my problem in a much more reliable manner than setting function environments manually. On Fri, 8 Mar 2024 15:46:52 -0600 (CST) luke-tier...@uiowa.edu wrote: > Having a reference to a large environment is

Re: [R] [External] Function environments serialize to a lot of data until they don't

2024-03-08 Thread luke-tierney--- via R-help
On Fri, 8 Mar 2024, Ivan Krylov via R-help wrote: Hello R-help, I've noticed that my 'parallel' jobs take too much memory to store and transfer to the cluster workers. I've managed to trace it to the following: # `payload` is being written to the cluster worker. # The function FUN had been

Re: [R] Capturing Function Arguments

2024-02-19 Thread Reed A. Cartwright
Thanks Ivan and Iris for your solutions, I'll look over them. The solution that I came up with last night involves creating a function that has the same formals signature as the wrapped function and relying on `environment()` and `list(...)` to return a function's variables at the beginning of

Re: [R] Capturing Function Arguments

2024-02-18 Thread Ivan Krylov via R-help
В Sat, 17 Feb 2024 11:15:43 -0700 "Reed A. Cartwright" пишет: > I'm wrapping a function in R and I want to record all the arguments > passed to it, including default values and missing values. This is hard if not impossible to implement for the general case because the default arguments are

Re: [R] Capturing Function Arguments

2024-02-18 Thread Iris Simmons
Hi Reed, I need to stress before giving my answer that no solution can handle everything. These scenarios will always lead to problems: * if any of the formal arguments rely on the current state of the call stack * if any of the formal arguments rely on a variable that is only defined later in

Re: [R] by function does not separate output from function with mulliple parts

2023-10-25 Thread Rui Barradas
Às 00:22 de 25/10/2023, Sorkin, John escreveu: Colleagues, I have written an R function (see fully annotated code below), with which I want to process a dataframe within levels of the variable StepType. My program works, it processes the data within levels of StepType, but the usual headers

Re: [R] by function does not separate output from function with, mulliple parts

2023-10-25 Thread Leonard Mada via R-help
Dear John, Printing inside the function is problematic. Your function itself does NOT print the labels. Just as a clarification: F = factor(rep(1:2, 2)) by(data.frame(V = 1:4, F = F), F, function(x) { print(x); return(NULL); } ) #   V F # 1 1 1 # 3 3 1 #   V F # 2 2 2 # 4 4 2 # F: 1 <- this

Re: [R] predict function type class vs. prob

2023-09-23 Thread Rolf Turner
On Fri, 22 Sep 2023 10:12:51 + "Milbert, Sabine (LGL)" wrote: > Dear R Help Team, In addition to other misapprehensions that others have pointed out, you seem to have a fundamental misunderstanding of R-help (and perhaps of R). There is no such thing as the "R Help Team". This is a

Re: [R] predict function type class vs. prob

2023-09-23 Thread David Winsemius
That's embarrassing. Apologies for the garbles HTML posting. I'll see if this is more readable: On 9/23/23 05:30, Rui Barradas wrote: Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: Dear R Help Team, My research group and I use R scripts for our multivariate data screening routines.

Re: [R] predict function type class vs. prob

2023-09-23 Thread Ivan Krylov
В Fri, 22 Sep 2023 10:12:51 + "Milbert, Sabine (LGL)" пишет: > PS: If this is an issue based on the model training function of the > caret package and therefore not your responsibility, please let us > know. Indeed, as Rui Barradas said, predict() is a generic function. Calling it with your

Re: [R] predict function type class vs. prob

2023-09-23 Thread David Winsemius
On 9/23/23 05:30, Rui Barradas wrote: > Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: >> Dear R Help Team, >> >> My research group and I use R scripts for our multivariate data >> screening routines. During routine use, we encountered some >> inconsistencies within the predict()

Re: [R] predict function type class vs. prob

2023-09-23 Thread Rui Barradas
Às 11:12 de 22/09/2023, Milbert, Sabine (LGL) escreveu: Dear R Help Team, My research group and I use R scripts for our multivariate data screening routines. During routine use, we encountered some inconsistencies within the predict() function of the R Stats Package. Through internal

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
You could also adjustcolor for this approach (levels of red, green, blue, alpha can all be adjusted proportionally) On 2023-07-23 5:35 p.m., David Stevens via R-help wrote: Nick, I've also made colors transparent by pasting the hex equivalent of, say, 0.3*256 = 76.9 to the hex color code.

Re: [R] col2rgb() function

2023-07-23 Thread David Stevens via R-help
Nick, I've also made colors transparent by pasting the hex equivalent of, say, 0.3*256 = 76.9 to the hex color code. e.q. for black it might be "#004d" and the 4d is 77 in hex. That way you don't need to convert back and forth so much. If col is "#00" the transparent version is tcol

Re: [R] col2rgb() function

2023-07-23 Thread Nick Wray
Thanks v useful to know Nick On Sun, 23 Jul 2023 at 21:13, Achim Zeileis wrote: > Just one addition which may or may not be useful: The color palette you > use is also known as "Okabe-Ito" and it is the default set of colors in > the palette.colors() function. This function also has an optional

Re: [R] col2rgb() function

2023-07-23 Thread Achim Zeileis
Just one addition which may or may not be useful: The color palette you use is also known as "Okabe-Ito" and it is the default set of colors in the palette.colors() function. This function also has an optional alpha argument. So if you want to generate these colors with an alpha of 0.3 you can

Re: [R] col2rgb() function

2023-07-23 Thread Nick Wray
Thanks That works nicely Nick On Sun, 23 Jul 2023 at 19:26, Ben Bolker wrote: >Does adjustcolor() help? > > cb8<- c("#00", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", > "#D55E00", "#CC79A7") > plot(0,0,xlim=c(1,8),ylim=c(0,1)) > points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2)

Re: [R] col2rgb() function

2023-07-23 Thread Duncan Murdoch
On 23/07/2023 2:15 p.m., Nick Wray wrote: Hello I have a palette vector of colour blind colours (in hexadecimal) which I’m using for plots, but they are not see-through, and as I wanted to overlay some histograms I wanted to convert these colours to rgb, when you can set the opacity. I have

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
Does adjustcolor() help? cb8<- c("#00", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", "#D55E00", "#CC79A7") plot(0,0,xlim=c(1,8),ylim=c(0,1)) points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2) points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2) On 2023-07-23 2:15

Re: [R] PROP_TEST function from INFER package

2023-05-15 Thread Marc Schwartz via R-help
Hi, You are using the prop_test() function from the infer CRAN package, with an argument set for an example using the prop_test() function from the rstatix CRAN package. They are **not** the same function, and do not take the same arguments, even though they have the same name. Read the help

Re: [R] seqMK function

2023-04-03 Thread Rasmus Liland
Dear Nick, Looking at dput(pheno::seqMK), dput(pheno::tau), and [1], I think you need to change the function pheno::tau to change the confidence level ... R [1] https://mannkendall.github.io/about.html#application-of-the-seasonal-mann-kendall-test

Re: [R] Generic Function read?

2023-02-28 Thread John Kane
Have a look at the {rio} package. On Tue, 28 Feb 2023 at 15:00, Leonard Mada via R-help wrote: > Dear R-Users, > > I noticed that *read* is not a generic function. Although it could > benefit from the functionality available for generic functions: > > read = function(file, ...)

Re: [R] Information function in CRM model

2022-01-06 Thread Bert Gunter
If you haven't already done so, you should probably look here: https://cran.r-project.org/web/views/Psychometrics.html Further detailed discussion of the statistics is generally off topic here. Per the posting guide (linked below): "Questions about statistics: The R mailing lists are primarily

Re: [R] Information function in CRM model

2022-01-06 Thread Cecilia Reyna
Please, forget and delete the previous post! Thanks! On Thu, Jan 6, 2022 at 7:02 AM Cecilia Reyna wrote: > Dear, > > I am trying to model the information function of items (and full) based on > the continuous response model. > > I am using the EstCRM (1.4) package, but it doesn't compute the

Re: [R] Improvement: function cut

2021-09-18 Thread David Winsemius
On 9/18/21 5:28 AM, Leonard Mada via R-help wrote: Hello Andrew, I add this info as a completion (so other users can get a better understanding): If we want to perform a survival analysis, than the interval should be closed to the right, but we should include also the first time point (as

Re: [R] Improvement: function cut

2021-09-18 Thread Leonard Mada via R-help
Hello Andrew, I add this info as a completion (so other users can get a better understanding): If we want to perform a survival analysis, than the interval should be closed to the right, but we should include also the first time point (as per Intention-to-Treat): [0, 4](4, 8](8, 12](12, 16]

Re: [R] Improvement: function cut

2021-09-17 Thread Bert Gunter
Perhaps you and Andrew should take this discussion off list... Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Sep 17, 2021 at 3:45 PM Leonard Mada via

Re: [R] Improvement: function cut

2021-09-17 Thread Leonard Mada via R-help
The warn should be in cut() => .bincode(). It should be generated whenever a real value (excludes NA or NAN or +/- Inf) is not included in any of the bins. If the user writes a script and doesn't want any warnings: he can select warn = FALSE. But otherwise it would be very helpful to catch

Re: [R] Improvement: function cut

2021-09-17 Thread Leonard Mada via R-help
Why would you want to merge different factors? It makes no sense on real data. Even if some names are the same, the factors are not the same! The only real-data application that springs to mind is censoring (right or left, depending on the choice): but here we have both open and closed

Re: [R] Improvement: function cut

2021-09-17 Thread Jeff Newmiller
Re your objection that "the user has to suspect that some values were not included" applies equally to your proposed warn option. There are a lot of ways to introduce NAs... in real projects all analysts should be suspecting this problem. On September 17, 2021 3:01:35 PM PDT, Leonard Mada via

Re: [R] Improvement: function cut

2021-09-17 Thread Leonard Mada via R-help
Hello Andrew, But "cut" generates factors. In most cases with real data one expects to have also the ends of the interval: the argument "include.lowest" is both ugly and too long. [The test-code on the ftable thread contains this error! I have run through this error a couple of times.] The

Re: [R] Improvement: function cut

2021-09-17 Thread Andrew Simmons
I disagree, I don't really think it's too long or ugly, but if you think it is, you could abbreviate it as 'i'. x <- 0:20 breaks1 <- seq.int(0, 16, 4) breaks2 <- seq.int(0, 20, 4) data.frame( cut(x, breaks1, right = FALSE, i = TRUE), cut(x, breaks2, right = FALSE, i = TRUE),

Re: [R] Improvement: function cut

2021-09-17 Thread Andrew Simmons
While it is not explicitly mentioned anywhere in the documentation for .bincode, I suspect 'include.lowest = FALSE' is the default to keep the definitions of the bins consistent. For example: x <- 0:20 breaks1 <- seq.int(0, 16, 4) breaks2 <- seq.int(0, 20, 4) cbind( .bincode(x, breaks1,

Re: [R] Improvement: function cut

2021-09-17 Thread Leonard Mada via R-help
Thank you Andrew. Is there any reason not to make: include.lowest = TRUE the default? Regarding the NA: The user still has to suspect that some values were not included and run that test. Leonard On 9/18/2021 12:53 AM, Andrew Simmons wrote: > Regarding your first point, argument

Re: [R] Improvement: function cut

2021-09-17 Thread Andrew Simmons
Regarding your first point, argument 'include.lowest' already handles this specific case, see ?.bincode Your second point, maybe it could be helpful, but since both 'cut.default' and '.bincode' return NA if a value isn't within a bin, you could make something like this on your own. Might be worth

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Eric Berger
Definitely doable and you are on the right path and maybe even close. The error message you got showed your query as having the wrong info after the 'FROM' keyword ' SELECT * FROM c("BIODBX.MECCUNIQUE2", "BIODBX.QDATA_HTML_DUMMY", "BIODBX.SET_ITEMS", "BIODBX.SET_NAMES", "dbo.sysdiagrams",

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Kai Yang via R-help
Hi Eric, Thank you spent time to help me for this. Here is the thing: I was requested to manage a sql server for my group. the server has many schemas and the tables (>200). I use ODBC to connect the server and get the schema name + table name into a data frame. For each of schema + table on

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Jeff Newmiller
Not all advice received on the Internet is safe. https://xkcd.com/327 https://db.rstudio.com/best-practices/run-queries-safely It is not that much more difficult to do it right. On July 2, 2021 12:05:43 PM PDT, Eric Berger wrote: >Modify the summ() function to start like this > >summ <-

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Eric Berger
Hard for me to tell without more details but it looks like the following has several bugs for (i in dbtable$Tot_table) { Tabname <- as.character(sqldf(sprintf("SELECT Tot_table FROM dbtable", i))) summ(Tabname) } Your sprintf() statement seems to use 'i' but actually does not. You probably

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Kai Yang via R-help
Hello Eric, Following your suggestion, I modified the code as: summ <- function(Tabname){   query <- sprintf(" SELECT * FROM %s",Tabname)   res <- dbGetQuery(con, query)   view(dfSummary(res), file = "W:/project/_Joe.B/MSSQL/try/summarytools.Tabname.html")   rm(res) } for (i in

Re: [R] R Function question, (repost to fix the messy work format)

2021-07-02 Thread Eric Berger
Modify the summ() function to start like this summ <- function(Tabname){ query <- sprintf(" SELECT * FROM %s",Tabname) res <- dbGetQuery(con, query) etc HTH, Eric On Fri, Jul 2, 2021 at 9:39 PM Kai Yang via R-help wrote: > Hello List, > > The previous post look massy. I repost my

Re: [R] .Last function in R 4.1.0

2021-06-07 Thread Duncan Murdoch
And to expand a bit: only the site file tries to put objects into the base package. The local .Rprofile file would put them into the global environment. So there's still support for .First and .Last, but it has changed. This abuses things a bit, but appears to work in an Rprofile.site

Re: [R] .Last function in R 4.1.0

2021-06-07 Thread Bert Gunter
According to the News file for 4.1.0 -- you should always check there first for such things -- "The base environment and its namespace are now locked (so one can no longer add bindings to these or remove from these)." So the docs do seem to need updating. Bert Gunter "The trouble with having

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread J C Nash
This is likely because Hessian is being approximated. Numerical approximation to Hessian will overstep the bounds because the routines that are called don't respect the bounds (they likely don't have the bounds available). Writing numerical approximations that respect bounds and other

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread Bill Dunlap
Does optim go out of bounds when you specify hessian=FALSE? hessian=TRUE causes some out-of-bounds evaluations of f. > optim(c(X=1,Y=1), > function(XY){print(unname(XY));(XY[["X"]]+1)^4+(XY[["Y"]]-2)^4}, method= > "L-BFGS-B", lower=c(0.001,0.001), upper=c(1.5,1.5), hessian=TRUE) [1] 1 1 [1]

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread J C Nash
Can you put together your example as a single runnable scipt? If so, I'll try some other tools to see what is going on. There have been rumours of some glitches in the L-BFGS-B R implementation, but so far I've not been able to acquire any that I can reproduce. John Nash (maintainer of optimx

Re: [R] mpfr function in Rmpfr crashes R

2021-03-07 Thread Duncan Murdoch
It works for me, on a slightly different system than yours: > Rmpfr::mpfr(pi, 120) 1 'mpfr' number of precision 120 bits [1] 3.1415926535897931159979634685441851616 > sessionInfo() R version 4.0.3 Patched (2021-01-30 r79912) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS

Re: [R] mpfr function in Rmpfr crashes R

2021-03-07 Thread John Fox
Dear Roger, This works perfectly fine for me on an apparently similar system, with the exceptions that I'm running R 4.0.4, have many fewer packages loaded, and am in a slightly different locale: --- snip > Rmpfr::mpfr(pi, 120) 1 'mpfr' number of precision 120

Re: [R] Dalex function in mlr3

2021-02-02 Thread Bert Gunter
Please note per the posting guide linked below: "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R ), ask questions on R-help. If the question relates to a *contributed

Re: [R] pgmm function errors in R

2021-01-22 Thread Bert Gunter
1. Please read the posting guide. Statistical questions and questions on non-standard (not shipped with standard R distro) packages are largely off topic here. 2. This CRAN task view might be of interest to you: https://cran.r-project.org/web/views/Econometrics.html 3. But as a general comment,

Re: [R] colMeans function

2020-11-04 Thread Rui Barradas
Hello, No, flights[2] is *not* equal to flights$months. The former is a data.frame with only one column, therefore it has a dimension attribute. The latter is a column, a vector of the data.frame flights, it does not have the attribute dim set. The difference is very important, see what

Re: [R] colMeans function

2020-11-04 Thread Marc Schwartz via R-help
Hi, You might want to become familiar with the ?str and ?dim functions, which can help you identify the structure of the objects that you are passing to colMeans(). In the first case, flights[2] is a data frame with a single column, so will have two dimensions with a row and column structure.

Re: [R] colMeans function

2020-11-04 Thread Duncan Murdoch
On 04/11/2020 8:26 a.m., Engin Yılmaz wrote: Dear I use *flights* database library(nycflights13) The following code is working as colMeans(flights[2]) * 6.54851* but other code is not working as colMeans(flights$month) *Error in colMeans(flights$month) : * * 'x' must be an array of at

Re: [R] [External] Function of "matrix"

2020-10-22 Thread Richard M. Heiberger
FAQ 7.31 > 10.1/.1 [1] 101 > print(10.1/.1, digits=17) [1] 100.99 > floor(10.1/.1) [1] 100 > floor(10.1*10) [1] 101 > matrix(0, 2.9, 3.9) [,1] [,2] [,3] [1,]000 [2,]000 > note that the dimension arguments are passed through floor() before they are used.

Re: [R] summarize_all Function

2020-10-02 Thread Jeff Reichman
Thanks Bill – got it From: Bill Dunlap Sent: Thursday, October 1, 2020 1:56 PM To: reichm...@sbcglobal.net Cc: r-help@r-project.org Subject: Re: [R] summarize_all Function The warning gives some suggestions. E.g., replace funs(sum,prod) with list(sum=sum,prod=prod). % R CMD Rscript

Re: [R] summarize_all Function

2020-10-02 Thread Jeff Reichman
Thanks Rui -Original Message- From: Rui Barradas Sent: Thursday, October 1, 2020 1:49 PM To: reichm...@sbcglobal.net; r-help@r-project.org Subject: Re: [R] summarize_all Function Hello, Any of the two will do, the first is now preferred. library(dplyr) mtcars %>% summar

Re: [R] summarize_all Function

2020-10-01 Thread Bill Dunlap
The warning gives some suggestions. E.g., replace funs(sum,prod) with list(sum=sum,prod=prod). % R CMD Rscript -e 'library(dplyr,warn.conflicts=FALSE); data.frame(X=1:3,Y=c(11,13,17)) %>% summarize_all(funs(sum,prod))' X_sum Y_sum X_prod Y_prod 1 641 6 2431 Warning message:

Re: [R] summarize_all Function

2020-10-01 Thread Rui Barradas
Hello, Any of the two will do, the first is now preferred. library(dplyr) mtcars %>% summarise(across(everything(), sum)) mtcars %>% summarise_all(sum) # no need for `funs()` Hope this helps, Rui Barradas Às 18:29 de 01/10/20, Jeff Reichman escreveu: r-help Forum I'm using

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rui Barradas
Hello, These two gives the same results: aggregate(values ~ sex + status, mydata, sum) #  sex status values #1   0  0    224 #2   1  0   5227 #3   0  1 11 #4   1  1    552 by(mydata$values, list(mydata$sex, mydata$status), sum) #: 0 #: 0 #[1] 224

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rasmus Liland
On 2020-07-24 01:48 +0200, Rasmus Liland wrote: > aggregate(x=list("values"=mydata$values), > by=list("sex"=mydata$sex, > "status"=mydata$status), > FUN=sum) > > yields > > sex status values > 1 0 0224 >

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rasmus Liland
On 2020-07-23 18:54 -0400, Duncan Murdoch wrote: > On 23/07/2020 6:15 p.m., Sorkin, John wrote: > > Colleagues, > > The by function in the R program below is not giving me the sums > > I expect to see, viz., > > 382+170=552 > > 4730+170=4900 > > 5+6=11 > > 199+25=224 > >

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Duncan Murdoch
On 23/07/2020 6:15 p.m., Sorkin, John wrote: Colleagues, The by function in the R program below is not giving me the sums I expect to see, viz., 382+170=552 4730+170=4900 5+6=11 199+25=224 ### #full R program: mydata <-

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Bert Gunter
by() chooses **data frame** subsets -- sum() is acting on these frames, adding up everything in them. Try this instead: > by(mydata,list(mydata$sex,mydata$status),function(x)sum(x$values)) : 0 : 0 [1] 224 --- : 1 : 0 [1] 5227

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Rasmus Liland
On 2020-05-13 13:13 -0700, Jeff Newmiller wrote: > In general, any time you deal with floating > point numbers having different magnitudes, > you risk pushing some low precision bits > out of the result. Simply changing the > sequence of calculations such as a literal > polynomial evaluation

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Jeff Newmiller
In general, any time you deal with floating point numbers having different magnitudes, you risk pushing some low precision bits out of the result. Simply changing the sequence of calculations such as a literal polynomial evaluation versus Horner's method can obtain different results. Take a

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Rasmus Liland
On 2020-05-13 11:44 -0700, Jeff Newmiller wrote: > Depending on reproducibility in the least > significant bits of floating point > calculations is a bad practice. Just > because you decide based on this one > example that one implementation of BLAS is > better than another does not mean that

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Jeff Newmiller
Depending on reproducibility in the least significant bits of floating point calculations is a bad practice. Just because you decide based on this one example that one implementation of BLAS is better than another does not mean that will be true for all specific examples. IMO you are drawing

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Rasmus Liland
On 2020-05-13 13:04 -0400, J C Nash wrote: > On 2020-05-13 11:28 a.m., Rasmus Liland wrote: > > > > I get another solution on my Linux i7-7500U > > > > > D %*% solve(D) > > [,1] [,2] > > [1,] 1.00e+000 > > [2,] 8.881784e-161 > > > sessionInfo() > > BLAS:

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread J C Nash
Note that my sessionInfo() gave R version 4.0.0 (2020-04-24) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Linux Mint 19.3 Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1 So you have an older R

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-13 Thread Rasmus Liland
On 2020-05-09 11:40 -0400, J C Nash wrote: > > > solve(D) > [,1] [,2] > [1,] -2.0 1.0 > [2,] 1.5 -0.5 > > D %*% solve(D) > [,1] [,2] > [1,]1 1.110223e-16 > [2,]0 1.00e+00 > > Dear list, I get another solution on my Linux i7-7500U laptop, but the same solution on

Re: [R] solve() function freezes CLI in GNU R 3.6.3 - SOLVED

2020-05-10 Thread Ko Byeongmin
Dear list, Dirk and Professor J.C. Nash gave me an invaluable help! Prof. Nash mentioned: > Possibly this is a quirk of the particular distro or machine, BLAS or > LAPACK[.] This was indeed the case, and Dirk's suggestion to > [install] libopenblas-openmp-dev" and > [remove] both

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel
On 9 May 2020 at 10:30, Dirk Eddelbuettel wrote: | | We can see that you use Linux. | | Are you by chance | | - on a Debian or Ubuntu system, and | - have the libopenblas package installed ? | | If so then it is a known bug with the libopenblas0-pthread package. | | Installing

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread J C Nash
I get the output at the bottom, which seems OK. Can you include sessionInfo() output? Possibly this is a quirk of the particular distro or machine, BLAS or LAPACK, or something in your workspace. However, if we have full information, someone may be able to run the same setup in a VM (if I have

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel
We can see that you use Linux. Are you by chance - on a Debian or Ubuntu system, and - have the libopenblas package installed ? If so then it is a known bug with the libopenblas0-pthread package. Installing libopen0-openmp (and also removing libopenblas0-pthread) should fix it. This is

Re: [R] custom function gives unexpected result - for me

2020-04-17 Thread Monica Palaseanu-Lovejoy
Hi, I cannot believe I did that. Usually I remember to add parenthesis but this time obviously I didn’t. Thank you all so much for answering so quickly. Thanks, Monica On Fri, Apr 17, 2020 at 7:06 PM Peter Langfelder wrote: > You need 1:(m-1) in your function. The operator : has precedence

Re: [R] custom function gives unexpected result - for me

2020-04-17 Thread Peter Langfelder
You need 1:(m-1) in your function. The operator : has precedence over -: > 1:3-1 [1] 0 1 2 > 1:(3-1) [1] 1 2 Happened to me a few times as well before I remembered. HTH, Peter On Fri, Apr 17, 2020 at 3:50 PM Monica Palaseanu-Lovejoy wrote: > > Hi, > > I wrote a relatively simple function. If

Re: [R] custom function insite dlys::mutate

2020-03-30 Thread Rasmus Liland
On 2020-03-30 13:21 +, SIMON Nicolas wrote: | Apparently the condition " if ( var1 > tt ) " | cannot be evaluated correcty. | | Could you please give me an advice to write it | properly? Hi! To understand what you wanted to do, I tried to recreate your example in classic R indexing of a

Re: [R] custom function insite dlys::mutate

2020-03-30 Thread Rasmus Liland
On 2020-03-30 13:21 +, SIMON Nicolas wrote: > Could you please give me an advice to write it > properly? Hi! To understand what you wanted to do, I tried to recreate your example in classic R indexing of a data.frame, then converting it to a tibble: var1 <- seq(0, 20, 1) var2 <-

Re: [R] custom function insite dlys::mutate

2020-03-30 Thread Jeff Newmiller
You are comparing a 21-element vector with a 1-element vector, which gives you 21 answers. Which one of those answers are you actually interested in? I am not sure what you are trying to accomplish here, so cannot offer further advice. On March 30, 2020 6:21:45 AM PDT, SIMON Nicolas wrote:

Re: [R] rgamma function produces NaN values

2020-03-06 Thread Sanna Soomro
s I am using are mvtnorm, GIGrvg, tmvtnorm, RGeode and >> truncnorm. >> >> >> >> Best regards >> >> Sanna >> >> >> >> *From: *Bert Gunter >> *Date: *Thursday, 5 March 2020 at 15:40 >> *To: *Sanna Soomro >> *Subject: *Re:

Re: [R] rgamma function produces NaN values

2020-03-06 Thread Bert Gunter
d my R code in the email but I don’t know if it gone > through. > > The gibb_lasso function is what I created myself. > > The packages I am using are mvtnorm, GIGrvg, tmvtnorm, RGeode and > truncnorm. > > > > Best regards > > Sanna > > > > *From: *Bert Gu

Re: [R] rgamma function produces NaN values

2020-03-05 Thread PIKAL Petr
Hi what is gibbs_lasso? I did not find any function of this name. Usually reproducible example greatly enhance your chances to get reasonable answer. If any n, a0, SIGMAgamma, b0 is NA rgamma gives you NA. Cheers Petr > -Original Message- > From: R-help On Behalf Of Sanna Soomro >

Re: [R] about .function

2020-01-30 Thread Bogdan Tanasa
appreciate it ! thank you Duncan ! On Thu, Jan 30, 2020 at 11:18 AM Duncan Murdoch wrote: > On 30/01/2020 1:38 p.m., Bogdan Tanasa wrote: > > Dear all, > > > > if I may ask please a very simple question : > > > > what does "." mean in front of function name : an example below . thank > > you

Re: [R] about .function

2020-01-30 Thread Duncan Murdoch
On 30/01/2020 1:38 p.m., Bogdan Tanasa wrote: Dear all, if I may ask please a very simple question : what does "." mean in front of function name : an example below . thank you very much ! .set_pbmc_color_11<-function() { myColors <- c( "dodgerblue2", "green4",

Re: [R] fa function in psych package and missing values

2019-08-01 Thread Gomez Cano, Mayam
Does fa function in psych package consider only complete cases when missing=FALSE? Why do I get slightly different results when I restrict my data to complete cases compared to the whole data with the default missing=FALSE? -- Sent from: http://r.789695.n4.nabble.com/R-help-f789696.html

Re: [R] Sample function and prob argument

2019-06-05 Thread Duncan Murdoch
On 05/06/2019 4:34 a.m., le Gleut, Ronan wrote: Dear R-help mailing list, First of all, many many thanks for your great work on the R project! I have a very small issue regarding the sample function. Depending if we specify values for the prob argument, we don't get the same result

Re: [R] The function sink() --delete everything before printing by "sink()"

2019-05-06 Thread Eric Berger
?sink for the HELP page on that sink() function. Check the description of the (optional) argument append to get an answer to your question. On Mon, May 6, 2019 at 5:24 AM John wrote: > I use the functions "sink" and "print" to print the results to a txt file. > May I delete everything in the

Re: [R] stukel function unavailable for some odd reason

2019-05-03 Thread Duncan Murdoch
On 03/05/2019 4:49 p.m., Paul Bernal wrote: Dear friends, I have been fitting a logistic regression and wanted to try a couple of goodness of fit tests on the model. Doing some research, I came across Chris Dardi's stukel and logiGOF functions from package LogisticDx v0.1. The current

Re: [R] picewise function in nls....

2019-04-19 Thread Ivan Krylov
On Fri, 19 Apr 2019 10:12:06 + akshay kulkarni wrote: > But what do you mean by "since fx does not depend on any of the > parameters you optimize in the nls() call."? Can you give an example? By "parameters you optimize in the nls() call" I mean `a`. `a` does not seem to be used in the

Re: [R] picewise function in nls....

2019-04-18 Thread Ivan Krylov
On Thu, 18 Apr 2019 10:36:10 + akshay kulkarni wrote: > fx <- (x1 <= -2)*(x1^2) + (x1 > -2 && x1 < 2)*(x1^3) + (x1 > = > 2)*(x1^4) > > Can I include fx in an nls call to create something like this: > > NLS1 <- nls(y ~ a*(sin(x2) + fx), start = list(a = 2)) ? For now, you can, since

Re: [R] lag function row name with

2019-03-25 Thread Eric Berger
Hi John, dplyr::lag expects a vector. The following should work dplyr::lag(temp[,1],2) HTH, Eric On Mon, Mar 25, 2019 at 9:45 AM John wrote: > Hi, > >I have a dataset whose row names corresponds to months. When I apply lag > function (dplyr package) on this dataset, I get NAs with

Re: [R] Solving Function using Conjugate Gradient

2019-03-20 Thread Bert Gunter
You should (almost) always also reply to the list, especially in this case, where others my also fail to help because they perceive your query as homework. However, I should warn you that such comprehensive queries are often dismissed as "do my work for me" requests. See the Posting Guide linked

Re: [R] Solving Function using Conjugate Gradient

2019-03-20 Thread Bert Gunter
This list has a no homework policy. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Mar 20, 2019 at 8:54 AM smart hendsome via R-help <

Re: [R] profvis function parse_rprof not being loaded

2019-03-01 Thread Winston Chang
Thanks for the heads up - I've updated the development version of profvis to export parse_rprof. -Winston On Thu, Feb 28, 2019 at 5:14 AM Duncan Murdoch wrote: > On 27/02/2019 9:42 p.m., nevil amos wrote: > > I have loaded the profvis library but the function parse_ rprof() is > > absent. >

Re: [R] profvis function parse_rprof not being loaded

2019-02-28 Thread Duncan Murdoch
On 27/02/2019 9:42 p.m., nevil amos wrote: I have loaded the profvis library but the function parse_ rprof() is absent. below is the session info show the absence of the function ( which is listed in the package help for the current version.) Looks as though they forgot to export it. You

Re: [R] geom_ribbon function in ggplot2 package

2018-12-19 Thread John
Thanks, Eik! Eik Vettorazzi 於 2018年12月19日 週三 下午5:12寫道: > Hi, > just add +scale_fill_discrete(name=NULL) > > Cheers > > Am 19.12.2018 um 07:05 schrieb John: > > Hi, > > > > When using the geom_ribbon function in gglot2 package, I got the text > > "fill" above the legend "A" and "B". How can

Re: [R] geom_ribbon function in ggplot2 package

2018-12-19 Thread Eik Vettorazzi
Hi, just add +scale_fill_discrete(name=NULL) Cheers Am 19.12.2018 um 07:05 schrieb John: Hi, When using the geom_ribbon function in gglot2 package, I got the text "fill" above the legend "A" and "B". How can I get rid of the text "fill" above the legend? Thanks! The code is as

Re: [R] TrendRaster function

2018-11-26 Thread Jeff Newmiller
a) You had to go out of your way to even install this package... it is lonly available on R-forge. This kind of question seems likely to require support from the package author. (Use the"maintainer" function to identify the author.) b) You may find a similar functionality in a CRAN package. Try

  1   2   3   4   5   6   7   8   9   10   >