Re: [R] unable to access index for repository...

2020-10-08 Thread Duncan Murdoch
He didn't specify the RStudio repos, though it's probably implicitly specified in getOption("repos"). I wonder why install.packages() is looking there, when repos is given explicitly? On 08/10/2020 8:54 a.m., Uwe Ligges wrote: Drop the RStudio repos. Best, Uwe Ligges On 05.10.2020 11:10,

Re: [R] Solving a simple linear equation using uniroot give error object 'x' not found

2020-10-06 Thread Duncan Murdoch
nd yfun(x,10,20) is not a function, it's the value of a function. You can do it with uniroot(function(x) yfun(x,10,20),c(-100,100)) which creates the anonymous function function(x) yfun(x,10,20) and passes that to uniroot(). Duncan Murdoch Thank you, John John David Sorkin M.D.,

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
On 29/09/2020 9:16 a.m., Puetz, Benno wrote: As I noted in my earlier post, it does - had checked that ;-) Great! Duncan Murdoch It works by taking corresponding pair fo the input vectors (after possible recycling, as eluded by Helmut in his remark on working on only one vector) as needed

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
That won't work unless power.TOST is vectorized. outer() will pass it vectors of x and y values. Duncan Murdoch On 29/09/2020 8:11 a.m., Helmut Schütz wrote: Dear Benno, THX, you made my day! Case closed. Helmut Puetz, Benno wrote on 2020-09-29 13:14: I would assume the following snippet

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
On 29/09/2020 5:37 a.m., Helmut Schütz wrote: Dear Duncan, Duncan Murdoch wrote on 2020-09-28 21:47: You're doing a lot of manipulation of the z matrix; I haven't followed all of it, but that's where I'd look for problems.  Generally if you keep your calculation of the z matrix very simple you

Re: [R] Problem with contour(): typo

2020-09-28 Thread Duncan Murdoch
ize function). Duncan Murdoch On 28/09/2020 3:08 p.m., Helmut Schütz wrote: Dear all, sorry, my last message contained a typo. Correct: library(PowerTOST) x    <- 0.90 y    <- 0.35 res  <- as.numeric(sampleN.TOST(theta0 = x, CV = y, design = "2x2x4",

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

2020-09-24 Thread Duncan Murdoch
. For Martin's use, it sounds as though quantreg::dither might be a better solution (though I think it won't work when numerical error splits ties, so some differences are extremely small, if the scale of the values varies too much, but I'd guess that's a fairly rare circumstance). Duncan Murd

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

2020-09-23 Thread Duncan Murdoch
fuzz" means, and perhaps allow it to be controlled by the user. Duncan Murdoch The function below prints the digits argument and then outputs d. The code is taken from jitter. f <- function(x){ z <- diff(r <- range(x[is.finite(x)])) cat("digits:", 3 - floor

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

2020-09-23 Thread Duncan Murdoch
)) By the time you get here, z is the length of the rante of the data, so it's 9 in your example. The rounding changes your values to 0,0,1e5, so the smallest difference is 1e5. Duncan Murdoch __ R-help@r-project.org mailing list --

Re: [R] date

2020-09-21 Thread Duncan Murdoch
Another way to do this is to use the xtfrm() function. That function creates numerical values from many different starting types, so you can just change the sign to change the sort order: df[order(df$ID, -xtfrm(df$date2)),] I never did figure out where the name came from. Duncan Murdoch

Re: [R] CRAN R For Windows 3.6.3

2020-09-19 Thread Duncan Murdoch
long CRAN will keep updating binary packages for R 3.6.3. I think that should continue until the release of R 4.1.0, sometime around April 2021. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] serialize does not work as expected

2020-08-29 Thread Duncan Murdoch
lized <- unserialize(serialize(l, connection=NULL, version=2)) 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

Re: [R] serialize does not work as expected

2020-08-29 Thread Duncan Murdoch
F-8 14 3 1 2 3 Notice how element 1 is a "compact_intseq" and element 2 is a "compact_realseq". Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Passing formula and weights error

2020-08-28 Thread Duncan Murdoch
s=newweights) } Duncan Murdoch On 28/08/2020 11:32 a.m., John Smith wrote: Dear R-help: I am writing a function based on glm and would like some variations of weights. In the code below, I couldn't understand why the second glm function fails and don't know how to fix it: Error in eval(extras, data, e

Re: [R] System Requirements

2020-08-22 Thread Duncan Murdoch
that R fails to run on Windows 7, you should like R Core know. Duncan Murdoch On 21/08/2020 1:52 p.m., Firpo, Mike via R-help wrote: Hello, Reading the FAQ, I'm confused about whether R 4.0.2 is tested on Windows 7. I found the following: 2.24 Does R run under Windows Vista/7/8

Re: [R] how to prove sum of probabilities to be one in R?

2020-08-20 Thread Duncan Murdoch
ating point. > > Could anyone please guide about that? Use the approximate test isTRUE(all.equal(p1+p2, 1)) If the default tolerance of sqrt(.Machine$double.eps) (about 1.5e-8) is wrong, change it: isTRUE(all.equal(p1+p2, 1, tolerance = 0.1)) This says anyth

Re: [R] install.packages() R vs RStudio

2020-08-17 Thread Duncan Murdoch
's a matter of taste. Personally, I've stopped reading the messages like "Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric" so they may as well be silent. Duncan Murdoch On 17/08/2020 10:02 a.m., John Fox wrote: Dear D

Re: [R] Best settings for RStudio video recording?

2020-08-17 Thread Duncan Murdoch
tall it; that may break RMarkdown if you don't have another copy somewhere.) To identify what R packages got installed, just run "installed.packages()" before and after installing RStudio, and look for differences. Duncan Murdoch Thank you! Ivan -- Dr. Ivan Calandra TraCEr, la

Re: [R] install.packages() R vs RStudio

2020-08-17 Thread Duncan Murdoch
he original function, and at the end update internal variables so they can show the library in the Packages pane. So there is no reason not to do it in R. By the way, saying that this is a "modified version of R" is like saying every single user who defines a variable cre

Re: [R] Reproducibility Between Local and Remote Computer with R

2020-08-09 Thread Duncan Murdoch
that if possible. You should look at the doRNG package, which addresses exactly this problem. See its vignette, vignette("doRNG", package="doRNG"). Duncan Murdoch On Sat, Aug 8, 2020 at 6:05 PM Abby Spurdle wrote: Hi Kevin, Intuitively, the first step would be to ensure th

Re: [R] Reproducibility Between Local and Remote Computer with R

2020-08-08 Thread Duncan Murdoch
a workspace in an old version and reloads it in a newer version, I believe they get the old version of the RNG. You need to check that the output of RNGkind() matches in all machines to know that they're using the same RNGs. Duncan Murdoch Three other possibilities: 1. Read news() for

Re: [R] How Can I Build a Standalone Binary

2020-08-07 Thread Duncan Murdoch
, then I'd suggest you work on automating a regular R installation, and put the things you want to run into scripts that make use of it. Two steps instead of one. Duncan Murdoch On 07/08/2020 5:10 p.m., Knecht, Logan wrote: Unfortunately, that is not a solution due to the constraints of file

Re: [R] How Can I Build a Standalone Binary

2020-08-07 Thread Duncan Murdoch
Wouldn't it be easier to set up a Shiny host system, and just give your collaborators a URL to the Shiny app running there? Duncan Murdoch On 06/08/2020 5:32 p.m., Knecht, Logan wrote: Hello all, = The short version = I am trying to build a standalone version for R so that I can

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-30 Thread Duncan Murdoch
This kind of search is probably also possible in other front ends (ESS etc.), and some purists probably know how to set it all up in command line BSD Unix, but I don't. Duncan Murdoch I am afraid I don't have time to dig into the source to identify which file you need. Keeping in mind that the

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-30 Thread Duncan Murdoch
On 29/07/2020 7:27 p.m., Rasmus Liland wrote: Dear Byron, On 2020-07-29 18:04 -0400, Duncan Murdoch wrote: The arrow3d function is also a pure R function, but not a generic. You can see the source by typing "arrow3d". ... but if I type rgl::shade3d, I get >

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-29 Thread Duncan Murdoch
ou are. The arrow3d function is also a pure R function, but not a generic. You can see the source by typing "arrow3d". Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Duncan Murdoch
in your expression of loglik, p is "a + b*x/(c+x)". Correct? p should be the probability of observing 1, so I would guess it is what you calculated below, i.e. exp(likelihood)/(1 + exp(likelihood)) (in your notation, not mine). Duncan Murdoch

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Duncan Murdoch
plifies a bit, and there are fast algorithms that are usually stable to optimize it. With a nonlinear model, you lose some of that, and I'd suggest directly optimizing it. Duncan Murdoch On 29/07/2020 8:56 a.m., Sebastien Bihorel via R-help wrote: Thank your, Pr. Nash, for your perspective on the

Re: [R] Writing Persian (Arabic) in a data frame

2020-07-28 Thread Duncan Murdoch
, but I don't know how to enable it, and I'm not certain that R will handle it properly: you may need a very recent version (perhaps unreleased) for R not to automatically assume that Windows can't do it. Duncan Murdoch (I should say when I make a vector of Persian names and I run it, I rec

Re: [R] Axis with inverse logarithmic scale

2020-07-27 Thread Duncan Murdoch
range as your plot; this will match that: plot(x_value, scale(y_values), axes = FALSE, ylim = scale(c(10, 99.9995))) The rest of the code is the same. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] Modifying dataframe with mutate()

2020-07-25 Thread Duncan Murdoch
Were you thinking of the %<>% operator? That's a magrittr thing, where x %<>% y acts like x <- x %>% y . Duncan Murdoch On 25/07/2020 4:18 p.m., Patrick (Malone Quantitative) wrote: Oh, right--I puzzled out my mistake. On Sat, Jul 25, 2020 at 4:17 PM Jeff Newmiller wrot

Re: [R] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-24 Thread Duncan Murdoch
in y axis.How do i do that using ggplot or any other way.Please help. Can you point to the URL of a plot online that is similar to what you want? I can't imagine a way to show 17298 character records in a graph in any useful way. Duncan Murdoch __ R

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

2020-07-23 Thread Duncan Murdoch
sum is 224 = 199+25 for 0,1, the sum is 11 = 5+6 for 1,0, the sum is 5227 = 4730 + 497 (not 4730 + 170) for 1,1, the sum is 552 = 382 + 170 Duncan Murdoch More complete explanation of my question I have created a simple dataframe having three factors:  mydata <- data.frame(c

Re: [R] Reading help functions

2020-07-22 Thread Duncan Murdoch
f interest in documentation if they don't: and I'd recommend avoiding such packages. To see the vignettes for "somepackage", run browseVignettes(package = "somepackage") Duncan Murdoch __ R-help@r-project.org mailing list -- To U

Re: [R] rgl terminology: the definitions of "thickness" and "width" in rgl

2020-07-21 Thread Duncan Murdoch
On 21/07/2020 5:00 a.m., Jim Lemon wrote: Hi Byron, As in the help page, three types of arrows can be specified. Actually four types: rotation, extrusion, lines, flat. But the rest of your answer is right. Duncan Murdoch In the "rotation" type, "width" is the param

Re: [R] Editing of .Rd files generated by roxygen2

2020-07-19 Thread Duncan Murdoch
in the PDF file. Also, I do not get \usage{} line in .Rd file for an Rcpp functions. You give examples below, but you don't say specifically what's wrong with them. Duncan Murdoch An example of an .Rd file and its corresponding R file are as follows: % Generated

Re: [R] chaining closure arguments on-the-fly

2020-06-21 Thread Duncan Murdoch
On 21/06/2020 11:37 a.m., Benjamin Tyner wrote: On 6/20/20 5:04 PM, Duncan Murdoch wrote: I think you effectively did that in your original post (all but encapsulating the expression in a function), so yes, it's possible. However, it's a really bad idea.  Why use non-standard evaluation when

Re: [R] chaining closure arguments on-the-fly

2020-06-20 Thread Duncan Murdoch
On 20/06/2020 4:44 p.m., Benjamin Tyner wrote: On 6/20/20 9:00 AM, Duncan Murdoch wrote: How about g <- function(x, y = x) {   f(x, y) } g(x = 3) or even yEqualsX <- function(f) function(x, y = x) f(x, y) yEqualsX(f)(x = 3) These are a lot like currying, but aren't currying, so th

Re: [R] chaining closure arguments on-the-fly

2020-06-20 Thread Duncan Murdoch
g f. How about g <- function(x, y = x) { f(x, y) } g(x = 3) or even yEqualsX <- function(f) function(x, y = x) f(x, y) yEqualsX(f)(x = 3) These are a lot like currying, but aren't currying, so they may be acceptable to you. Personally I'd choose the first one. Dunca

Re: [R] smoothScatter() and the KernSmooth package

2020-06-19 Thread Duncan Murdoch
On 19/06/2020 9:59 a.m., Jeffrey Dick wrote: Hi Witold, See also this thread on R-pkg-devel. Quoting Duncan Murdoch, "That looks like a bug in grDevices." Yes, and the bug is still there: grDevices:::.smoothScatterCalcDensity calls KernSmooth::bkde2D without checking whether

Re: [R] Error: cannot remove prior installation of package ‘BiocManager’

2020-06-19 Thread Duncan Murdoch
if you've got a .Rprofile (or similar) file running automatically on startup. A simpler solution to this is to use RStudio; it will automatically restart R if necessary when installing a package. Duncan Murdoch Best Regards *Ankush Sharma* On Fri, Jun 19, 2020 at 1:56 PM Uwe Ligges wrote

Re: [R] R 4.0.1 crashes with R Commander

2020-06-08 Thread Duncan Murdoch
it from here: https://cloud.r-project.org/bin/windows/base/rpatched.html 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] Creating file from raw connection

2020-05-29 Thread Duncan Murdoch
ill write it without changes. 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 comm

Re: [R] Notational derivative in R

2020-05-14 Thread Duncan Murdoch
. There's also `D` and related functions in base R. Duncan Murdoch HTH, Eric On Thu, May 14, 2020 at 8:43 PM Christofer Bogaso < bogaso.christo...@gmail.com> wrote: Hi, I was wondering if R can perform notational derivative something like Mathematica does as explained in

Re: [R] Bug in function arguments autocomplete and ellipsis?

2020-05-08 Thread Duncan Murdoch
t;key.legend.axes" for the same reason. This is expected behaviour. If you don't want to allow partial matching to arguments, they need to be placed *after* the ellipsis. Those arguments will need to be spelled out in full. Duncan Murdoch ___

Re: [R] Warning in install.packages : converting NULL pointer to R NULL

2020-05-08 Thread Duncan Murdoch
That looks like an RStudio message. Do you get it if you run install.packages() in command line R? Duncan Murdoch On 08/05/2020 8:07 a.m., Rui Barradas wrote: Hello, R 4.0.0 on Ubuntu 20.04, sessionInfo() below. Since I updated to R 4.0 that every time I try to install a package

Re: [R] unstable results of nlxb fit

2020-05-07 Thread Duncan Murdoch
of a mess you're dealing with. Duncan Murdoch On 07/05/2020 9:12 a.m., PIKAL Petr wrote: Dear all I started to use nlxb instead of nls to get rid of singular gradient error. I try to fit double exponential function to my data, but results I obtain are strongly dependent on starting values

Re: [R] Problems installing rgl (3D graphics package). Error messages "... not available, " "non-zero exit status" and so on

2020-05-04 Thread Duncan Murdoch
it to work, or upgrade to 3.6.3 (the previous version, very stable) or 4.0.0 (the current version). Duncan Murdoch I've been using R for about 15 years but only as a casual user. I have installed two packages in the past, but the last was several years ago. When I issued the command "instal

Re: [R] Question about "sample" function and inconsistent results I am getting across machines.

2020-05-03 Thread Duncan Murdoch
er-groups/. (I haven't checked how similar those two lists are.) Duncan Murdoch Thank you, Tom Fomby Department of Economics SMU Dallas, TX 75275 ------------ *From:* Duncan Murdoch *Sent:* Sunday, May 3, 2020 2:32 PM *To:*

Re: [R] Question about "sample" function and inconsistent results I am getting across machines.

2020-05-03 Thread Duncan Murdoch
I just tried both versions, and it's the ASUS that's using the buggy old algorithm. Duncan Murdoch On 03/05/2020 3:32 p.m., Duncan Murdoch wrote: On 03/05/2020 1:39 a.m., Fomby, Tom wrote: Please consider the following code: set.seed(1) train.index = sample(181,150) head(train.index) # [1

Re: [R] Question about "sample" function and inconsistent results I am getting across machines.

2020-05-03 Thread Duncan Murdoch
ers should run RNGkind(sample.kind = "Rejection") to start using the corrected sampling algorithm. (The default was changed in R 3.6.0, but if you saved your seed from a previous version, you'd get the old sampler). They should also stop relo

Re: [R] CRAN library down?

2020-05-01 Thread Duncan Murdoch
I recommend cloud.r-project.org. It is very well maintained by the RStudio folks. 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] Rtools required

2020-04-30 Thread Duncan Murdoch
place to ask for help on RStudio. Duncan Murdoch On 29/04/2020 9:48 p.m., Steven wrote: Thanks to all - very helpful. I search from c:\ and now find file .Renviron located in C:\Users\USER\Documents. That does it. I would like to pose an additional question, since it would also fall under the same

Re: [R] Rtools required

2020-04-28 Thread Duncan Murdoch
nes, but I don't know if it will still run its test for Rtools if you do it that way. I imagine you can also update RStudio and all of your packages; eventually that will work, if this is really the issue. Duncan Murdoch Also, where can I find file .Renviron. On 2020/4/28 下午 11:08, Duncan Mur

Re: [R] Rtools required

2020-04-28 Thread Duncan Murdoch
On 28/04/2020 11:02 a.m., Steven Yen wrote: In RStudio, I enter File -> Open Project -> and browse to open a .Rproj file. Then, I click Build -> Build Binary Package. Thanks. Do it the standard way instead of using devtools. Duncan Murdoch On 2020/4/28 下午 10:55, Duncan Murd

Re: [R] Rtools required

2020-04-28 Thread Duncan Murdoch
On 28/04/2020 9:56 a.m., Steven Yen wrote: Thanks. I visited the Rtools web page and learned to run the following lines. I am still getting the same warning message. And you are still not telling us what command you used to trigger that message. Duncan Murdoch > writeLines('P

Re: [R] Rtools required

2020-04-28 Thread Duncan Murdoch
you didn't put it on your path, or you used a non-standard way to build. You need to say what command you used. 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: [R] Information from a webpage using R

2020-04-27 Thread Duncan Murdoch
didn't answer it because it looks like homework (or a takehome exam), and we don't do those here. I'd suggest you give some more context on why you need to do this, if it's not homework/exam. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] Can I use R for comertial projects for free?

2020-04-21 Thread Duncan Murdoch
to license your project in a compatible way, e.g. GPL, and distribute its full source. Nothing stopping you from doing that commercially. Duncan Murdoch Thanks in advance. Best Regards, Dmitry [[alternative HTML version deleted]] __ R

Re: [R] display math with subscripts from a sequence

2020-04-18 Thread Duncan Murdoch
ng to type the individual expressions one by one? e <- expression() for (i in 1:30) e <- c(e, eval(substitute(expression(x[i]), list(i = i plot(1:30, 1:30, type="n") text(1:30, 1:30, labels=e) Duncan Murdoch __ R-help@

Re: [R] Error with devTools

2020-04-14 Thread Duncan Murdoch
No, I mean the path to the other Rtools. I think the only solution to avoid the quiet = TRUE is to modify the devtools package, or don't use it. Duncan Murdoch On 14/04/2020 4:18 a.m., iurii.chernia...@t-systems.com wrote: Hi Duncan , Thank you for your answer, you mean R path? I have

Re: [R] Error with devTools

2020-04-13 Thread Duncan Murdoch
etc can't be found, but devtools::test hides the information that would confirm that, because it compiles with quiet = TRUE hard coded. Duncan Murdoch Error from console: Loading space Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command

Re: [R] question about system.file()

2020-04-10 Thread Duncan Murdoch
ge="SNPRelate") I have in current directory from where I would run this function a file named output4.bed Just use "output4.bed" as the filename. The system.file() function is for working out the filename of files installed in packages. Duncan Murdoch in order to

Re: [R] 2D and 3D graphing

2020-03-24 Thread Duncan Murdoch
", back = "lines", specular = "black") Duncan Murdoch On 24/03/2020 5:42 p.m., EK Esawi via R-help wrote: Thank you Jeff. I have been using a textbook which has some of the chart types i was hoping to produce; that's 3D charts where points are connected by lines in 3

Re: [R] Strange error message, many thanks

2020-03-21 Thread Duncan Murdoch
R = 500, formula = y_obs ~ b+z+a) boot.ci(results, type="bca") # # # # # # # # # # # # # # # # # # # # # # # # # Try using debug(MSE), and you'll see that d[["yobs "]] doesn't exist, so your MSE function always returns NaN. Duncan Murdoch

Re: [R] find multiple mode

2020-03-15 Thread Duncan Murdoch
differences. But there may be a simpler way Presumably this is a homework question. Your answer is perfect for one of those; more detail would be inappropriate. Duncan Murdoch On Mon, Mar 16, 2020 at 10:24 AM Jim Lemon wrote: Hi Ding, Translating this into R code: freq<

Re: [R] Relatively Simple Maximization Using Optim Doesnt Optimize

2020-03-13 Thread Duncan Murdoch
ves (your ripples), so the fact that it is sticking to one step size is a sign that it is not working. If those ripples are big enough to matter (and I'm not convinced of that), it should take highly variable steps. The fact that it doesn't give a warning() when it knows it has failed to con

Re: [R] Relatively Simple Maximization Using Optim Doesnt Optimize

2020-03-12 Thread Duncan Murdoch
On 12/03/2020 7:25 p.m., Abby Spurdle wrote: There is nothing in that plot to indicate that the result given by optim() should be accepted as optimal. The numerical approximation to the derivative is 0.055851 everywhere in your graph That wasn't how I intended the plot to be interpreted. By

Re: [R] Relatively Simple Maximization Using Optim Doesnt Optimize

2020-03-12 Thread Duncan Murdoch
is unnecessary, and inefficient. (2) Possible problems with the CG method are noted in the documentation. (3) Numerical approximations of the function's derivative need to be well-behaved for gradient-based numerical methods to work properly. On Fri, Mar 13, 2020 at 3:42 AM Duncan Murdoch wrote:

Re: [R] Relatively Simple Maximization Using Optim Doesnt Optimize

2020-03-12 Thread Duncan Murdoch
It looks like a bug in the CG method. The other methods in optim() all work fine. CG is documented to be a good choice in high dimensions; why did you choose it for a 1 dim problem? Duncan Murdoch On 12/03/2020 2:30 a.m., Skyler Saleebyan wrote: I am trying to familiarize myself with optim

Re: [R] Installing Packages

2020-03-11 Thread Duncan Murdoch
either. I'd recommend trying with "yes", then trying again with "no" if there were any install failures. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Reporting a bug in as function

2020-03-03 Thread Duncan Murdoch
p page for is.numeric. There's no bug in having is.integer(n1) == is.numeric(n1). 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] file.choose()

2020-03-03 Thread Duncan Murdoch
k you always get that version. On other platforms it may depend on which front end you're using. 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

Re: [R] Accessing Data From packages

2020-02-27 Thread Duncan Murdoch
g. filename <- file.choose() hof <- read_csv(filename) That will open a standard dialog to allow you to specify the filename correctly. If you don't know where to look for it, I can't help: presumably instructions are given in the book, but I don't have a copy. You'll just have to read more of i

Re: [R] A behaviour pattern that I find mysterious.

2020-02-26 Thread Duncan Murdoch
to spend a lot of time reading a help page. Not sure it'll answer your question, though... 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 postin

Re: [R] make check fails -- how to debug

2020-02-12 Thread Duncan Murdoch
ble to provide better help installing latest R on a CentOS server than me. I just had a similar error on Ubuntu. Inconsolata is not a standard TeXLive font, on Ubuntu you need to install texlive-fonts-extra to get it. Duncan Murdoch __ R-help@

Re: [R] make check fails -- how to debug

2020-02-12 Thread Duncan Murdoch
k] Error 2 At the end of that run, you'll see the log of the failed test in tests/reg-packages.Rout.fail (or some name a lot like that). You'll have to figure out why it failed from that log. Duncan Murdoch __ R-help@r-project.org ma

Re: [R] Question about autocomplete Keyboard Shortcut in R Markdown Latex

2020-02-05 Thread Duncan Murdoch
of them, and I don't know if it would be feasible to add LaTeX completions to it. (R does have a primitive LaTeX parser in tools::parseLatex, so it's not completely infeasible.) Duncan Murdoch On February 5, 2020 8:09:35 AM PST, Bert Gunter wrote: Try posting this at the RStudio Help site

Re: [R] doing 1000 permutations and doing test statistics distribution

2020-02-04 Thread Duncan Murdoch
s, Bert did suggest that, but it's obviously wrong. The argument to FUN is an element of seq_len(10), it's not the full dataset. Try result<- lapply(seq_len(10), FUN = function(i){ dat <- dat2[, sample.int(4)] print(colnames(dat)) } ) Duncan Murdoch On Tue, Feb 4, 2020 at 3:10 P

Re: [R] about .function

2020-01-30 Thread Duncan Murdoch
#FB9A99", # pink "orchid", "red") It means that the default ls() won't list the function, you'd need ls(all.names = TRUE). By convention such functions are usually meant for internal use, but there are lots of exceptions to that conventi

Re: [R] Strange behaviour of R?

2020-01-17 Thread Duncan Murdoch
t('FUN was called') test <- function(FUN, args) { print(FUN) FUN(args) } test(NULL, 1:10) Duncan Murdoch Actually, I used something like test(mean, list(x=1:10, na.rm=TRUE)) which actually crashed R, but I can not reproduce it. Of course, when I replaced FUN(args) with do.call(

Re: [R] Reporting missing dates

2020-01-16 Thread Duncan Murdoch
followed by one missing day. 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

Re: [R] choose(n, k) as n approaches k

2020-01-14 Thread Duncan Murdoch
On 14/01/2020 10:50 a.m., peter dalgaard wrote: On 14 Jan 2020, at 16:21 , Duncan Murdoch wrote: On 14/01/2020 10:07 a.m., peter dalgaard wrote: Yep, that looks wrong (probably want to continue discussion over on R-devel) I think the culprit is here (in src/nmath/choose.c) if (k

Re: [R] choose(n, k) as n approaches k

2020-01-14 Thread Duncan Murdoch
ould be as simple as replacing n by R_forceint(n) in the k = n - k step. I think that would break symmetry: you want choose(n, k) to equal choose(n, n-k) when n is very close to an integer. So I'd suggest the replacement whenever R_IS_INT(n) is true. Duncan Murdoch -pd On 14

Re: [R] choose(n, k) as n approaches k

2020-01-14 Thread Duncan Murdoch
source to lchoose() seems to already do this: it handles your examples nicely. 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] Fwd: Which external functions are called in a package?

2020-01-03 Thread Duncan Murdoch
the tests with the old and new version of my package, but I believe there is similar code out there nowadays to do the comparison. I'd look in devtools if I was looking for that.) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Which external functions are called in a package?

2020-01-03 Thread Duncan Murdoch
i, but I believe the first argument is to the source directory for a package. It looks as though you are pointing to the installed copy of it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/ma

Re: [R] outer join of xts's

2020-01-02 Thread Duncan Murdoch
st which becomes the arguments to the function being called. Your time series should be unnamed entries in the list, while other arguments to merge() should be named. Duncan Murdoch Thanks, Eric On Thu, Jan 2, 2020 at 3:23 PM Gabor Grothendieck wrote: You don't need Reduce as xts a

Re: [R] rmgarch: source package installation problem

2019-12-30 Thread Duncan Murdoch
tput of sessionInfo() at the end. https://pastebin.com/z7ZwU9iR I hope somebody can tell me what may cause this. You didn't show us the command you used to install it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://

Re: [R] Using older version of R

2019-12-20 Thread Duncan Murdoch
to the CRAN archives for older versions of some packages. One approach is to use Microsoft's daily CRAN snapshots and get everything that was current in the past, but even they don't go back to March 2014 when 3.0.3 was current. Duncan Murdoch __ R-help@r

Re: [R] how to change format of dates in a tibble

2019-12-18 Thread Duncan Murdoch
ng something like dateRanges %>% mutate_all(function(x) format(x, format = "%d %b %Y")) and then auto-printing will show you the formatted output. This is a little risky, since it applies the formatting function to all columns; in your example it works, but you might need to use

Re: [R] table and unique seems to behave differently

2019-12-10 Thread Duncan Murdoch
numeric(names(tab)) tab #> 3.4 3.4 #> 1 1 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.h

Re: [R] table and unique seems to behave differently

2019-12-10 Thread Duncan Murdoch
p+1, 0x1.b3335p+1) identical(x, c(0x1.bp+1, 0x1.b3335p+1)) #> [1] TRUE 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] how to deal with deprecated functions

2019-12-05 Thread Duncan Murdoch
lve any new problems. 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, min

Re: [R] package MCMCpack

2019-12-04 Thread Duncan Murdoch
rball. You should use install.packages(packageurl, type="source", repos=NULL) However, you may still have problems: when I tried that, the install failed because of C++ errors. I don't know if configure options (e.g. specifying a particular version of C++) would have fixed the probl

Re: [R] graphical parameter "srt" has the wrong length

2019-11-27 Thread Duncan Murdoch
On 27/11/2019 11:22 a.m., Farid Cheraghi wrote: Hi all, Is srt parameter in text() not vectorized? No, it's documented (indirectly) as "A numerical value". (See ?par.) Duncan Murdoch plot(1:10, type='n') text(1:10, 1:10, letters[1:10], srt=rep(c(0, 90),5)) gives error:

Re: [R] Why don't the comments appear in the function?

2019-11-25 Thread Duncan Murdoch
true, but there may be cases where it's not true, in which case you'll need to use something like environment(fn) as the envir argument. Duncan Murdoch Very respectfully, Neal Fultz On Mon, Nov 25, 2019 at 10:49 AM Duncan Murdoch wrote: On 24/11/2019 6:06 p.m., bic...@math.usask.ca wrote:

Re: [R] Why don't the comments appear in the function?

2019-11-25 Thread Duncan Murdoch
t you used to create flist, or enough of it to show this behaviour? Showing us (or me privately) dput(flist) might be enough to see what's going on. Duncan Murdoch flist[[3]] function(y,brackets,rates){ # Calculates before-tax income required to realized value y ints&l

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Duncan Murdoch
read.table -> file In addition: Warning message: In file(file, "rt") : cannot open file 'NA.matrix': No such file or directory Execution halted Your script works with the third element in the list of arguments, and there are only two. Duncan Murdoch Please advise On Sat, Nov 23, 2019

Re: [R] cannot open file '--no-restore.matrix'

2019-11-23 Thread Duncan Murdoch
open the connection Calls: read.table -> file In addition: Warning message: In file(file, "rt") : cannot open file 'NA.matrix': No such file or directory Execution halted You didn't put the print(cmd_args) into the script. Duncan Murdoch Please advise, Ana On Sat, Nov 23, 2019

<    1   2   3   4   5   6   7   8   9   10   >