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

2019-11-23 Thread Duncan Murdoch
irst line cmd_args=commandArgs() to cmd_args <- commandArgs(TRUE) makes a lot of sense in most cases. I haven't read your whole script so I don't know it it makes sense for you. Duncan Murdoch Please advise, Ana On Sat, Nov 23, 2019 at 4:16 AM Ben Tupper wrote: Hi, I think you wa

Re: [R] Problem comparing two strings

2019-11-18 Thread Duncan Murdoch
ke library(utf8) string1 <- utf8_normalize(string1) string2 <- utf8_normalize(string2) string1 == string2 # Should now work as expected Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] Problems with lambda argument

2019-11-18 Thread Duncan Murdoch
so I think you'll have to post a reproducible example if you want help. 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] QQ plot

2019-11-12 Thread Duncan Murdoch
-log10(p), or adding 3 to the reference line, as Ana requested. Or just multiply them by 1000 and pass them to qq(): qq(dd$P*1000, main = "Q-Q plot of small GWAS p-values") As far as I can see, there's no way to tell qqman::qq to move the reference line. Duncan Murdoch J

Re: [R] Identifying presence of Java

2019-11-09 Thread Duncan Murdoch
n", stdout = TRUE, stderr = TRUE) These are based on reading the help pages, which sometimes helps. 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 p

Re: [R] Order axis by number of entries in lattice plot

2019-11-04 Thread Duncan Murdoch
On 04/11/2019 9:25 a.m., Duncan Murdoch wrote: On 04/11/2019 8:31 a.m., Luigi Marongiu wrote: Dear all, I am plotting some values with lattice barchart: the y-axis is automatically ordered alphabetically; is it possible to order the entries by number, so that the 'larger' histograms would

Re: [R] Order axis by number of entries in lattice plot

2019-11-04 Thread Duncan Murdoch
rder(Normal + Tumour + Metastasis) df$Ordered <- ordered(Family, levels = Family[o]) barchart(Ordered ~ Normal+Tumour+Metastasis, data = df, stack = TRUE, xlim=c(1,1000), main = "Ordered by total", xlab = expression(bol

Re: [R] save() unable to find object

2019-10-31 Thread Duncan Murdoch
On 31/10/2019 5:17 a.m., Christofer Bogaso wrote: As I said the name 'AAA31' is itself a variable. So I cant hard-code it within the save() function Use the list= argument to save(). Duncan Murdoch On Thu, Oct 31, 2019 at 2:45 PM Jim Lemon wrote: Hi Christofer, This is a guess, but have

Re: [R] decomposing a string representing a valid mathematical expression?

2019-10-29 Thread Duncan Murdoch
x assumes. I think Witold's request is quite hard to do. The right way to handle expressions is as hierachical objects, like those returned from parse(text = z). Turning those into character vectors of lexical tokens doesn't make sense. Perhaps if Witold explained the context of what he is tryi

Re: [R] Conversion from python to R - log-problem

2019-10-27 Thread Duncan Murdoch
On 27/10/2019 7:01 p.m., Martin Møller Skarbiniks Pedersen wrote: Hi, I am trying to convert a small python computation to R but my R version gets the wrong result. You are using log10() in R, when you should be using log(). The python code: import math import log x = log(2) for i in

Re: [R] negative vector length when merging data frames

2019-10-23 Thread Duncan Murdoch
y "merge"). Are those from dplyr and base? Showing us str(lr), str(asign), and sessionInfo() would be helpful. Duncan Murdoch dim(l4) [1] 166941635 8 dim(asign) [1] 107371528 5 On Wed, Oct 23, 2019 at 5:32 PM Ana Marija wrote: Hello, I have two data frames lik

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread Duncan Murdoch
On 06/10/2019 8:23 a.m., vod vos wrote: The problem is aa, bb and cc all in a single csv file contains no blank line. So what steps do you need, and which of them do you need help with? Duncan Murdoch The single csv file like list output. aa(cm) 1, 2 , 3, bb(mm) 1, 2, 3, 4, 5, 6

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread Duncan Murdoch
e rules for expanding that you'll need in your real data, but for your example step 4 could be aa <- rep(aa, each = 3) Then step 5 could be result <- data.frame(aa, bb, cc) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread Duncan Murdoch
o* options with underscores, and a dozen with embedded hyphens. Duncan Murdoch Best Regards, W. Michels, Ph.D. On Fri, Sep 27, 2019 at 9:04 AM Martin Maechler wrote: Martin Maechler on Mon, 23 Sep 2019 16:14:36 +0200 writes: Richard O'Keefe on Sat, 21 Sep 2019 09:39:18 +1200 writes:

Re: [R] Real Basic Question

2019-09-26 Thread Duncan Murdoch
isn't obvious: you need to load it into an empty location (either your global environment in a clean new session, or one created specially for the purpose). E.g. env <- new.env() load("~/Baseball/RetroSheetDocumentation/ari18.test2.rda", envir = env) ls(

Re: [R] static vs. lexical scope

2019-09-26 Thread Duncan Murdoch
uot;environment" in particular), and this could end up confusing users who don't need the more general overview. I think Hadley's description in Advanced R (online here: https://adv-r.hadley.nz/functions.html#lexical-scoping) is a pretty clear description of how R wor

Re: [R] static vs. lexical scope

2019-09-26 Thread Duncan Murdoch
's not really a mystery. Duncan Murdoch On Thu, 26 Sep 2019 at 23:56, Martin Møller Skarbiniks Pedersen wrote: On Wed, 25 Sep 2019 at 11:03, Francesco Ariis wrote: Dear R users/developers, while ploughing through "An Introduction to R" [1], I found the expression "static scop

Re: [R] Creating a simple function

2019-09-21 Thread Duncan Murdoch
AM PDT, Duncan Murdoch wrote: On 21/09/2019 7:38 a.m., Jeff Newmiller wrote: The dplyr::select function returns a special variety of data.frame called a tibble. I don't think that's always true. The docs say it returns "An object of the same class as .data.", and that's what I'm

Re: [R] Creating a simple function

2019-09-21 Thread Duncan Murdoch
c(1,1,2,2), b=1:4) %>% subset(a == 1)) 'data.frame': 2 obs. of 2 variables: $ a: num 1 1 $ b: int 1 2 But I believe there are other dplyr functions that take dataframes as input and return tibbles, I just don't know which ones. Duncan Murdoch The tibble has certain features designed t

Re: [R] Creating a simple function

2019-09-20 Thread Duncan Murdoch
Presumably data %>% select(col1, col2) isn't giving you a dataframe. However, you haven't given us a reproducible example, so I can't tell you what it's doing. But that's where you should look. Duncan Murdoch __ R-help@r-project.org mailing l

Re: [R] [SPAM] Re: The "--slave" option

2019-09-19 Thread Duncan Murdoch
use of this my first reaction was don't feed the trolls. Why have a second reaction? Trolls are bullies, bullies should be ignored. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/li

Re: [R] Help needed with eval parse

2019-09-18 Thread Duncan Murdoch
sentations of them, because it's hard to do that without introducing changes. In other words, don't use eval(parse()). Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] R wrong, Python rigth in calcution

2019-09-17 Thread Duncan Murdoch
]] Please don't post HTML to the list -- it's a plain text list. That's also pretty well documented. 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

Re: [R] Warning from installing packages in R3.6.1

2019-09-16 Thread Duncan Murdoch
; if not, you probably have to contact them to find out why it's showing up. The R team can't do anything about it. Duncan Murdoch On 15/09/2019 10:07 p.m., Steven Yen wrote: Hello Duncan: Below I am sending (1) message from installation of a .zip file; (2) from installation of aod from CRAN; (3

Re: [R] Warning from installing packages in R3.6.1

2019-09-15 Thread Duncan Murdoch
On 15/09/2019 1:44 a.m., Steven Yen wrote: Can someone help me understand why Rtools is needed when installing a package from CRAN, and from a zipped file? What's the point? Please don't just repeat your post when you've been asked for additional supporting information. Duncan Murdoch

Re: [R] Warning from installing packages in R3.6.1

2019-09-14 Thread Duncan Murdoch
lly run "Install.packages", not "install.packages"? R is case sensitive, so those are different. But in any case, that message probably isn't coming from R, it is coming from some contributed package or front end. Posting the result of sessionInfo() would help us to diagnose where

Re: [R] test if something was plotted on pdf device

2019-09-12 Thread Duncan Murdoch
operations ... if (dev.cur() == 1 || identical(recordPlot(), blankPlot)) plot(ecdf(rnorm(100))) else plot(ecdf(rnorm(100)), add=TRUE, col=i) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/ma

Re: [R] Reading large files with R

2019-09-01 Thread Duncan Murdoch
work is being done by a C routine, but it's conceivable you could use the stringi::stri_read_raw function to do the reading, and convince the C routine to handle the raw value instead of a character value. - Find a way to split up your file into smaller pieces. Duncan Murdoch ___

Re: [R] Accessing C source files

2019-08-05 Thread Duncan Murdoch
l versions are in subdirectories of https://svn.r-project.org/R/tags . Pick one of these, and then follow links to src etc. within it. Duncan Murdoch On Monday, 5 August 2019, 15:32:00 CEST, Jeff Newmiller wrote: Seems like you are looking in the wrong place. Did you download the sourc

Re: [R] does pdf() work inside of a function?

2019-07-28 Thread Duncan Murdoch
things in your function; quantmod does very complicated things in getSymbols(). One of those complicated things is breaking, it's not pdf() that's breaking. Duncan Murdoch R version 3.6.0 (2019-04-26) on Mac 10.14.5 # R --silent --vanilla < s2.r library(quantmod) options("getSym

Re: [R] install_github broken for dependencies on packages previously installed from private github repo.

2019-07-26 Thread Duncan Murdoch
You posted this identical question to https://stackoverflow.com/q/57206597/2554330, and didn't fix it based on the comment asking for a reproducible example. Please don't crosspost. On 25/07/2019 3:15 p.m., Mark Mendel wrote: When installing from a private repo, fails if the package depends

Re: [R] Regarding R licensing usage guidance

2019-07-23 Thread Duncan Murdoch
to distribute copies of R and other packages come from their licenses. If you don't follow their licenses, you may be in violation of their copyright. Duncan Murdoch I am sorry , it all came out in wrong way.I didn't intended to hurt anyones sentiment. I totally love the community and it's work so

Re: [R] Problem with save/load across R versions and OS

2019-07-17 Thread Duncan Murdoch
(either by you, when you notice a bug in the contributed package and can fix it, or by one of us, when you post the reprex and we dig in). Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] Problem with save/load across R versions and OS

2019-07-17 Thread Duncan Murdoch
s readRDS. If that's not just a typo above, then the loadRDS function you're using doesn't work. Use the base package functions instead. - There's a bug in R. In any case, we can't do much to help you without a reproducible example. Duncan Murdoch _

Re: [R] hist{graphics}

2019-07-13 Thread Duncan Murdoch
a more faithful representation of discrete data using something like plot(table(x)) Duncan Murdoch On 2019/7/12 下午 05:10, Steven wrote: # Can someone help with this simple frequency histogram problem (n = 15)? # I use four class limits: [90,95], [95,100], [100,105], [105,110

Re: [R] need help in if else condition

2019-07-10 Thread Duncan Murdoch
ot;else stmt.2" is not a valid statement. I'm sure that's just a typo, but I can't think of a variation on it that is different from the one before. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/ma

Re: [R] Reloading old R Environments/Workspaces

2019-07-04 Thread Duncan Murdoch
is generated based on time of day and process number, so is almost certainly different in every session. (Sometimes you want a repeated seed for reproducibility, but it's always bad when you're surprised by one.) Duncan Murdoch __ R-help@r-project.org

Re: [R] Control the variable order after multiple declarations using within

2019-07-03 Thread Duncan Murdoch
everse order to what you want, e.g. within(df, {c <- a; b<-a*2; c<-b*3}) but to me that is a lot less clear than Eric's solution. Duncan Murdoch On July 3, 2019 8:25:32 AM PDT, Eric Berger wrote: Nice suggestion, Richard. On Wed, Jul 3, 2019 at 4:28 PM Richard O'Keefe w

Re: [R] sd in aggregate and help.search/?? seem not to work as usual in latest version

2019-07-01 Thread Duncan Murdoch
On 01/07/2019 8:28 p.m., Duncan Murdoch wrote: On 01/07/2019 5:41 a.m., Marvin Kiene wrote: Additionally, the 'help.search()' always just gives the result: "No results found", for all of my students. Those students are probably using RStudio. This appears to be an incom

Re: [R] sd in aggregate and help.search/?? seem not to work as usual in latest version

2019-07-01 Thread Duncan Murdoch
This will cause lots of things to appear in an external browser instead of in the RStudio display, so it's not the nicest workaround, but at least it's fairly easy. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, se

Re: [R] Object and file sizes

2019-06-28 Thread Duncan Murdoch
obably roughly proportional to the object.size() results. 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-guid

Re: [R] Add transitivity to a matrix?

2019-06-18 Thread Duncan Murdoch
get different results if I set M[13, 17] <- TRUE or leave it FALSE. Hopefully people found the transitivity discussion interesting, even if I won't use it for this problem. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE a

Re: [R] Add transitivity to a matrix?

2019-06-17 Thread Duncan Murdoch
o also become TRUE *after* M[i,k] changes.  This seems to imply that an iterative solution is necessary. Right, that's a good point. Duncan Murdoch One such procedure, via repeated matrix multiplication to check for and impose transitivity, appears to be suggested by this discussion: https://math

Re: [R] plotting an isosurface on a 3d plot

2019-06-17 Thread Duncan Murdoch
ges together into a single PNG, and use texture coordinates to choose which image is used for each vertex. It's probably a lot more trouble than just plotting the surfaces separately. I am thankful for the rare previlige of directly getting help from the developer of the rgl package on this foru

[R] Add transitivity to a matrix?

2019-06-17 Thread Duncan Murdoch
& M[j,k] both being TRUE implies M[i,k] is TRUE? The operation should only change FALSE or NA values to TRUE values; TRUE values should never be changed. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, se

Re: [R] Add transitivity to a matrix?

2019-06-17 Thread Duncan Murdoch
On 17/06/2019 1:19 p.m., Duncan Murdoch wrote: Suppose I have a square logical matrix M which I'm thinking of as a relation between the row/column numbers. I can make it into a symmetric relation (i.e. M[i,j] being TRUE implies M[j,i] is TRUE) by the calculation M <- M |

Re: [R] plotting an isosurface on a 3d plot

2019-06-14 Thread Duncan Murdoch
nto the shade3d() call in the same way, or the material argument to qmesh3d. Duncan Murdoch Once again, I would like to thank you for your fantastic help. Thanking you, Ravi On Thursday, 13 June 2019, 22:52:07 CEST, Duncan Murdoch wrote: On 13/06/2019 4:32 p.m., Duncan Murdoch wrote:

Re: [R] plotting an isosurface on a 3d plot

2019-06-13 Thread Duncan Murdoch
On 13/06/2019 4:32 p.m., Duncan Murdoch wrote: On 13/06/2019 12:47 p.m., ravi via R-help wrote: Hi,I want to plot a surface joining a circle on a plane with another circle (a little offset w.r.t. the first one) on a parallel plane. This is a very simplified version of my problem. I

Re: [R] plotting an isosurface on a 3d plot

2019-06-13 Thread Duncan Murdoch
quads3d(quads, col = "green") There are more efficient ways to do this (the for loop would be slow if you had bigger vectors), but this should give you the idea. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo

Re: [R] LaTeX Error in creating manual from Rd files

2019-06-11 Thread Duncan Murdoch
(confirmed by my.package-manual.log, my.package-manual.tex, Rdlatex.log): You have \describe with no \item. That leads to illegal LaTeX. Instead of \describe{ bar \tabular{ll}{ ... you should have \describe{ \item{bar}{ \tabular{ll}{ ... } Duncan Murdoch Rd: \format

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

2019-06-11 Thread Duncan Murdoch
you start R, it will be fine on Linux, as far as I can see. I wouldn't choose that as the default way to run R (it's pretty irritating not to have readline support), but it is a workaround for this bug. Duncan Murdoch Hence, if you have a Windows machine that can look at the file syst

Re: [R] interpretation of R output for exact permutation test

2019-06-07 Thread Duncan Murdoch
ution for the statistic when calculating that probability. Duncan Murdoch am I completely out of track? sorry but I'm here missing the point somewhere, somehow... thank you for the feedback [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] Pasting R code lines into labels

2019-06-06 Thread Duncan Murdoch
These look like very fragile suggestions. Allow x^2 to be an argument (named expr, for example) to plotFx, don't force a user to write a function in a very particular way. Then use deparse(substitute(expr)) in the title. Duncan Murdoch On 06/06/2019 4:33 p.m., Bert Gunter wrote: Well

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

2019-06-06 Thread Duncan Murdoch
On 06/06/2019 5:04 p.m., Richard O'Keefe wrote: How can expanding tildes anywhere but the beginning of a file name NOT be considered a bug? It looks like a bug in R, but not necessarily a bug in libreadline: we may just be using tilde_expand improperly. Duncan Murdoch On Thu, 6 Jun

Re: [R] debug only top level function

2019-06-06 Thread Duncan Murdoch
in R exts or R intro manual. Maybe it would be worth considering to add something about it to debug help page. It's in the ?browser help page, which is linked from ?debug. Duncan Murdoch Best regards Petr -Original Message----- From: Duncan Murdoch Sent: Thursday, June 6, 2019 11:11 AM

Re: [R] debug only top level function

2019-06-06 Thread Duncan Murdoch
Enter without choosing one, it will do the same as the previous time, so you've probably used "s" sometime in the past. Duncan Murdoch Best regards Petr sessionInfo() R Under development (unstable) (2018-03-07 r74369) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows

Re: [R] Sample function and prob argument

2019-06-05 Thread Duncan Murdoch
ULL) { if (!is.null(prob) && max(prob) == min(prob)) prob <- NULL sample(x = x, size = size, replace = replace, prob = prob) } You might want a looser tolerance on the vector of probabilities depending on your context. Duncan Murdoch __ R-help

Re: [R] how to identify record with broken format

2019-06-05 Thread Duncan Murdoch
,2," 1,2,5 1,2,"6" I see > count.fields("~/temp/test.txt",sep=",") [1] 3 3 NA NA NA 3 indicating that there are problems on lines 3-5 (a missing closing quote on line 3). Duncan Murdoch __ R-help@r-project.org ma

Re: [R] Mysterious NOTE when checking package

2019-06-03 Thread Duncan Murdoch
h at the end, which was added by R CMD build. If you don't have a line like that, you'll get the note you saw. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] cygwin clipboard

2019-05-23 Thread Duncan Murdoch
. The X11() message is suspicious. I'm wondering what type of object you're trying to copy...? I think Ed was running the Cygwin build of R. Cygwin can run the Windows build of R, and it sounds as though that's what you did (and what Ed should do.) Duncan Murdoch

Re: [R] cygwin clipboard

2019-05-21 Thread Duncan Murdoch
unable to contact X11 display Is this supported in any way? Thanks Cygwin is not supported in any way by the R project, as far as I know. There's a native Windows build that is supported, and I'd strongly recommend you use it instead. Duncan Murdoch _

Re: [R] How to publish a new package on CRAN

2019-05-14 Thread Duncan Murdoch
On 14/05/2019 2:42 p.m., Rui Barradas wrote: Hello, There is a mailing list dedicated to package development. See https://stat.ethz.ch/mailman/listinfo/r-package-devel There are also instructions to follow at https://cran.r-project.org/web/packages/policies.html Duncan Murdoch Hope

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

2019-05-03 Thread Duncan Murdoch
version of LogisticDx is 0.2 from 2015, and it doesn't export those functions. Source for version 0.1 from 2014 is available, and it does contain those functions, but I wouldn't touch them with a ten foot pole unless I first heard from the author why he left them out of the next release. Duncan

Re: [R] Passing formula as parameter to `lm` within `sapply` causes error [BUG?]

2019-04-30 Thread Duncan Murdoch
have to follow this rule, but it causes lots of confusion when they don't. Duncan Murdoch Best, Jens [Disclaimer: This is my first post here, following advice of how to proceed with possible bugs from here: https://www.r-project.org/bugs.html] SUMMARY While `lm` alone accepts formula

Re: [R] Message produced under R 3.6.0.

2019-04-29 Thread Duncan Murdoch
On 29/04/2019 9:44 p.m., Rolf Turner wrote: On 30/04/19 1:31 PM, Duncan Murdoch wrote: On 29/04/2019 9:25 p.m., Duncan Murdoch wrote: On 29/04/2019 8:43 p.m., Rolf Turner wrote: On 30/04/19 12:19 PM, Jeff Newmiller wrote: Since you now have this indirect dependency, you should make sure

Re: [R] Message produced under R 3.6.0.

2019-04-29 Thread Duncan Murdoch
On 29/04/2019 9:25 p.m., Duncan Murdoch wrote: On 29/04/2019 8:43 p.m., Rolf Turner wrote: On 30/04/19 12:19 PM, Jeff Newmiller wrote: Since you now have this indirect dependency, you should make sure you have updated this gaggle of packages. I have found that the dependencies do

Re: [R] Message produced under R 3.6.0.

2019-04-29 Thread Duncan Murdoch
.quosures rlang is due to issues with ggplot2 or rlang. Have you tried updating both of those? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] Surface plots....

2019-04-25 Thread Duncan Murdoch
. If they are a set of irregular points, there aren't so many. One possibility is to use persp3d(z ~ x + y) (see ?persp3d.formula for help.) Use rglwidget() to write it in a form you can view in a web browser. Duncan Murdoch Thanks Bernard McGarvey Director, Fort Myers Beach Lions Foundation, Inc

Re: [R] Surface plots....

2019-04-25 Thread Duncan Murdoch
if you want a particular recommendation, such as what form your data is in, what you want the plot to look like, what medium do you want to display it on, etc. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] Example for Roxygen @eval tag?

2019-04-22 Thread Duncan Murdoch
nt in Rd files, and perhaps also in roxygen. Doing the search through the source code also turned up @evalRd and @evalNamespace, which might be worth exploring. Duncan Murdoch Thanks Jeff, Boris On 2019-04-22, at 02:25, Jeff Newmiller wrote: What tag are you creating with the eval? Your e

Re: [R] Can one perform a dry run of a package installation?

2019-04-09 Thread Duncan Murdoch
interested in finding how dependencies would be recursively updated to newer versions. Set the `lib` parameter of `install.packages` to an empty directory, and see what gets installed there. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] Convert a character to numeric

2019-04-09 Thread Duncan Murdoch
g more sensible to do with NA values. You may also have character strings that cannot be converted into numbers, which will also generate NA values. I think that's the only way that message will appear. Duncan Murdoch Maybe a little example will help us to understand: charstr<-c("5

Re: [R] Unable to read csv files with comma in values

2019-04-07 Thread Duncan Murdoch
s = FALSE) }) tmp2 <- tmp1 %>% bind_rows(.id = "id") tmp3 <- tmp2 %>% select(id, User, Rule) tbl <- tmp3 %>% distinct() (You don't need pipes here, but it will make it easier to put the giant expression back together at the end.)

Re: [R] Fw: problem with nlsLM function

2019-03-19 Thread Duncan Murdoch
M2 and HM3 are predictors. The problem is I get the same error even when I use nlsLM(in the minpack.lm package): nonlin_modDH5 <- nlsLM(formulaDH5, start = list(a = 0.43143, b = 2,A = 0.09,w = 0.8,a = 0.01,C = 0.94)) You have "a" twice in your start list. That's bound to cause tro

Re: [R] ?grid::grid-package doesn't find the grid-package help page

2019-03-18 Thread Duncan Murdoch
On 18/03/2019 1:00 p.m., Jeff Newmiller wrote: Try ?grid::`grid-package` The "-" is not a legal character in a bare symbol. Or package?grid::grid which makes use of the rarely used "type" argument to "?". Duncan Murdoch On March 18, 2019 9:35:17 AM PDT, Wi

Re: [R] Global counter in library

2019-03-12 Thread Duncan Murdoch
counter best implemented? Use the Rdsm package. See ?Rdsm::Rdsm for help. Duncan Murdoch Here is a basic sketch of what I tried: library(parallel) library(flock) ## begin of code in package tmp <- tempfile() .localstuff <- new.env() .localstuff$N <- 0 .localstuff$tmp <- temp

Re: [R] Installing package into...

2019-03-12 Thread Duncan Murdoch
tal message. But, is there a way to do a cleaner installation without getting such message? Thanks. Have you tried specifying the library? Then R wouldn't tell you its guess. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and m

Re: [R] rgl.postscript hang

2019-03-10 Thread Duncan Murdoch
So far I haven't been patient enough to know what x <- (-90:90)/5 would take. This doesn't really make sense: with x <- (-n:n)/5 it will need to sort (2n + 1)^2 objects, but that should take something proportional to n^2 log(n) time, and the time seems to be growing faster than that.

Re: [R] [FORGED] Q re: logical indexing with is.na

2019-03-10 Thread Duncan Murdoch
bout 5 milliseconds when the difference comes last, but 0.006 milliseconds when it comes first. Of course, all(x == y) and identical(x, y) do slightly different tests: read the docs! Duncan Murdoch Thanks again! DLG On Sat, Mar 9, 2019 at 9:07 PM Jeff Newmiller wrote: Regarding the

Re: [R] Remove Even Number from A Vector

2019-03-03 Thread Duncan Murdoch
a dataset of restaurant sales. Not a native English speaker here; what exactly do you mean by "odd" in this case? "Odd" numbers have a remainder of 1 when divided by 2; "even" numbers are multiples of 2. Duncan Murdoch If I ignore the "subject" field, it look

Re: [R] add points to lattice cloud plot (3D scatter)

2019-02-28 Thread Duncan Murdoch
but you'll need to do more work yourself to get an array of plots like lattice gives. Duncan Murdoch Thank you df = data.frame(Name = c("A", "B", "C", "D", "E"), x_axis = c(-0.591, 0.384, -0.384, -0.032, 0.754),

Re: [R] profvis function parse_rprof not being loaded

2019-02-28 Thread Duncan Murdoch
can get to it using profvis:::parse_rprof, but the maintainer (who is cc'd) might want to fix this. Duncan Murdoch Documentation for package ‘profvis’ version 0.3.5 DESCRIPTION file. Help Pages parse_rprof Parse Rprof output file for use with profvis pause Pause an R process print.profvis

Re: [R] Error trapping in R

2019-02-27 Thread Duncan Murdoch
unction(y) }) if (inherits(value, "try-error")) { cat ("something went wrong. There's information in value about what happened.") } else { cat ("value is fine, there was no error.") } Duncan Murdoch _

Re: [R] Replacing each NA with the most recent non-NA prior to it

2019-02-26 Thread Duncan Murdoch
! There are at least two packages (zoo and imputeTS) which have na.locf functions. The one in zoo does what you want: > zoo::na.locf(c(NA,NA,1,4,NA,2), na.rm=FALSE) [1] NA NA 1 4 4 2 Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCR

Re: [R] Ghost variables

2019-02-25 Thread Duncan Murdoch
g options(warn=2) before your script, and then the script will die at the first warning. Duncan Murdoch On 25/02/2019 3:45 p.m., jlu...@ria.buffalo.edu wrote: The script is complete. When I start, the environment is empty. The warnings are issued for these "ghost" variables well bef

Re: [R] [FORGED] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Duncan Murdoch
ably thousands of them. Duncan Murdoch Personally I haven't got a clue what you are asking. Also, please note that r-help is a world wide "community" with hundreds of thousands of members. (I am but one of this large and unruly mob.) It is not a single entity or "site&qu

Re: [R] Why is there error in as.POSIXlt.character when using strftime()?

2019-02-02 Thread Duncan Murdoch
;16:00" "16:46" "16:51" "17:35" "17:59" "18:17" "19:07" "19:08" [18] "19:31" "21:21" "06:00" "06:20" "06:37" "06:40" "06:46" "07:20" "07:4

Re: [R] Packages

2019-01-23 Thread Duncan Murdoch
. Perhaps the mirror you used doesn't have it? I'd recommend using the cloud.r-project.org mirror rather than a local one in almost any case. In any case, Neal's advice to update R is likely to make your life a lot easier. Duncan Murdoch > install.packages("car") Installing

Re: [R] Packages

2019-01-23 Thread Duncan Murdoch
ch the packages, you haven't told R to look in the alternate location. 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.or

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-23 Thread Duncan Murdoch
ause even though secret is defined in the caller of g() and is therefore in the call stack, that's irrelevant: it's not in g's evaluation frame (which has no variables) or its parent (which is the global environment if those definitions were evaluated there). Duncan Murdoch Generally, u

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-23 Thread Duncan Murdoch
ultInsideFn <- function() print(secret) secret <- 'secret' inside() } which is essentially equivalent, other than having a shorter header on the outside() function. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] Was there a change to R ver. 3.5.2 so that it now treats warnings during installs as errors?

2019-01-20 Thread Duncan Murdoch
ing) installation of package ‘/tmp/Rtmp4hnMMO/file7fb929638ed8/gGnome_0.1.tar.gz’ had non-zero exit status That message indicates that options("warn") is 2 or higher when the warning occurs. What is its setting before you start the install? Duncan Murdoch ___

Re: [R] User Interfaces for R

2019-01-10 Thread Duncan Murdoch
) describes the major R packages for GUI programming: RGtk2, qtbase, Tcl/Tk, and gWidgets. That book was published in 2012, and things have moved on since then. Eric's suggestion of Shiny is newer, and is a really well-designed system. A fairly steep learning curve, but worth it. Duncan

Re: [R] Diff'ing 2 strings

2019-01-10 Thread Duncan Murdoch
::Rdiff should get what you want even in that version. But as you note, it isn't a general purpose diff for character vectors, it is targeted at comparing R output files. Duncan Murdoch - Original Message - From: "Jeff Newmiller" To: r-help@r-project.org, "Se

Re: [R] Why does R do this?

2019-01-08 Thread Duncan Murdoch
ow Thierry's advice, and don't use which() unless you really need a vector of indices, and are prepared for an empty one. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] Accessing Data Frame

2019-01-03 Thread Duncan Murdoch
always produced by subsetting the deck. If a user does something like topCard <- data.frame(face = "queen", suit = "spades", value = 12) then the rownames won't match, and removing topCard will remove the wrong one. Duncan Murdoch Benoit Jeff Newmiller a écrit

Re: [R] Accessing Data Frame

2019-01-03 Thread Duncan Murdoch
rd$face & deck$suit == card$suit & deck$value = card$value) } removeCard <- function(deck, card) { deck[-whichCard(deck, card), ] } deck <- removeCard(deck, topCard) Duncan Murdoch Benoit Jeff Newmiller a écrit : In my programmer's head, something similar to this should "w

Re: [R] Function for displaying arbitrary text as in 'help'.

2019-01-02 Thread Duncan Murdoch
. It is possible to have dynamic content in help pages. Web pages (e.g. generated using R-markdown or Shiny) are even more flexible for content, but maybe not meeting your requirement for displaying in an ESS buffer or Linux terminal window. Duncan Murdoch El mié., 2 ene. 2019 a las 14:31, Jeff

Re: [R] Function for displaying arbitrary text as in 'help'.

2019-01-02 Thread Duncan Murdoch
. 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, minimal, self-contained

Re: [R] Function for displaying arbitrary text as in 'help'.

2019-01-02 Thread Duncan Murdoch
to display help. You might be able to adapt it to your own needs, though it won't be trivial. 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

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