Re: [R] as.data.frame doesn't set col.names

2017-10-25 Thread Duncan Murdoch
6.3 (Data frames). Note that dd$B is nearly the same as dd[["B"]], not dd["B"]. Duncan Murdoch (I am perfectly happy if you write the explanation but if it saves you time to point to some reference that works fine for me.) Regards, Eric On Wed, Oct 25, 2017 at 2:27

Re: [R] R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R

2017-11-01 Thread Duncan Murdoch
essage the interpreter. Has someone an idea why the original program code stops (only) at line 698: tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar";))? Perhaps your system is resolving foo.bar to a web address. If I use a URL for a web page that does

Re: [R] R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R

2017-11-01 Thread Duncan Murdoch
On 01/11/2017 12:02 PM, Albrecht Kauffmann wrote: Dear Duncan, Many thanks! Am Mi, 1. Nov 2017, um 16:17, schrieb Duncan Murdoch: On 01/11/2017 8:11 AM, Albrecht Kauffmann wrote: Hi all, after compiling R-3.4.2 on opensuse leap 42.3, make check failed. Until R-3.4.1 I never had a problem

Re: [R] R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R

2017-11-01 Thread Duncan Murdoch
On 01/11/2017 1:08 PM, Albrecht Kauffmann wrote: Am Mi, 1. Nov 2017, um 17:40, schrieb Duncan Murdoch: On 01/11/2017 12:02 PM, Albrecht Kauffmann wrote: Dear Duncan, Many thanks! Am Mi, 1. Nov 2017, um 16:17, schrieb Duncan Murdoch: On 01/11/2017 8:11 AM, Albrecht Kauffmann wrote: Hi all

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Duncan Murdoch
can have a function addOne <- function(x) { x + 1 } and you can call it lots of times from other functions without printing a line each time. Duncan Murdoch On Thu, Nov 2, 2017 at 11:54 AM, David Winsemius wrote: On Nov 2, 2017, at 9:27 AM, Ed Siefker wrote: I have a function:

Re: [R] Missing information in source()

2017-11-07 Thread Duncan Murdoch
On 07/11/2017 3:01 PM, Tom Backer Johnsen wrote: Dear R-help, I am running a Mac under Sierra, with R version 3.4.2 and RStudio 1.1.383. When running head () or tail () on an object in a script using source (

Re: [R] Risks of using "function <- package::function" ?

2017-11-16 Thread Duncan Murdoch
ning: replacing previous import ‘stats::filter’ by ‘dplyr::filter’ when loading ‘testpkg’. 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

Re: [R] Risks of using "function <- package::function" ?

2017-11-17 Thread Duncan Murdoch
les don't exist, and his student's suggestion seems like a reasonable idea, more in the spirit of named imports than using "library(pkg)" or "require(pkg)". Duncan Murdoch __ R-help@r-project.org mailing list -- To U

Re: [R] HTML documentation is not in the expected location

2017-11-17 Thread Duncan Murdoch
nyone tell me how to put the HTML documentation files in the right place? By default the documentation is produced on demand, but you can ask to produce it all at once. See section 2.2 of the Installation and Administration manual. Duncan Murdoch __

Re: [R] Complicated analysis for huge databases

2017-11-18 Thread Duncan Murdoch
or after the first line: Error: unexpected '{' in " for (i in length(SeparatedGroupsofmealsCombs) {" Once that line is thrown away, the message about i makes sense: AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) )) refers to

Re: [R] change colour in barplot

2017-11-20 Thread Duncan Murdoch
main ="Well Site Construction Emissions", legend.text=c("Land", "Access", "Well"), args.legend = list(x="bottom", horiz="TRUE", bty="n", inset=c(-0.5, -0.25))) So you'll need to give us a reproducible exa

Re: [R] Σχετ: change colour in barplot

2017-11-20 Thread Duncan Murdoch
't know which one is better for you, but I like the vector solution better. Duncan Murdoch Hope this will help. Many thanks, Maria Στις 11:53 π.μ. Δευτέρα, 20 Νοεμβρίου 2017, ο/η Duncan Murdoch έγραψε: On 20/11/2017 6:38 AM, Maria Lathouri via R-help wrote: >  Dear all >

Re: [R] Best way to study internals of R ( mix of C, C++, Fortran, and R itself)?

2017-11-21 Thread Duncan Murdoch
and for NumPy/Pandas/SciPy ? The web page <http://r4stats.com/articles/popularity/> is fairly up to date. It doesn't say what things were like in 2002, but in early 2017, the ranking was Python > R > SAS in the count of job ads in data science. In 2012 it was SAS > Python >

Re: [R] function pointers?

2017-11-22 Thread Duncan Murdoch
} > format(object.size(closureList), units = "Mb") [1] "19.2 Mb" > Rprof(NULL) > summaryRprof() Error in rowsum.default(c(as.vector(new.ftable), fcounts), c(names(new.ftable), : unimplemented type 'NULL' in 'HashTableSetup' In addition: Warning m

Re: [R] installing "rgl" package

2017-11-23 Thread Duncan Murdoch
ed in HTML. You need the OpenGL development packages. On Ubuntu, that probably means MesaGL, but I don't know the names of the development packages. Duncan Murdoch * installing *source* package ‘rgl’ ...checking for gcc... gcc -std=gnu99 checking whether the C compiler works... yes

Re: [R] number to volume weighted distribution

2017-11-24 Thread Duncan Murdoch
n't have a function for this, but Google says it exists in a couple of packages: spatstat, Hmisc. But you seem to be asking about a definition rather than a function: it is obtained simply by normalizing the weights to sum to 1, then evaluating cumulative sums of them. Duncan

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
t is looking for in /usr/lib/x86_64-linux-gnu. Do you have that file? Is it there, and marked as executable? It's probably a symbolic link; on an old Ubuntu system I just checked, it points to mesa/libGL.so, which is also a symlink, pointing to mesa/libGL.so.1.2.0, which is executable.

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
was in /usr/lib/x86_64-linux-gnu/mesa/. Duncan Murdoch /usr/lib/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/mesa/libGL.so Thanks again, Santosh On Fri, Nov 24, 2017 at 12:39 PM, Duncan Murdoch mailto:murdoch.dun...@gmail.

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
I'd recommend uninstalling it, making sure there's no remnant of Mesa anywhere, then reinstalling it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] installing "rgl" package

2017-11-26 Thread Duncan Murdoch
have indicated that the header is missing. You're missing the library. According to one of your earlier messages, it sounded as though the missing file is /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0. Duncan Murdoch * installing *source* package ‘rgl’ ... ** package ‘rgl’ successfully

Re: [R] source files in temp environment

2017-12-02 Thread Duncan Murdoch
;- function() { source("file.R", local = TRUE) } sourceit() With respect to your last comment (turning the code in file.R into functions which don't leave their locals behind): I think that would be the best solution. You may find it clunky now, but in the long run it likely wi

Re: [R] Please to remove the warning when trying to check a package.

2017-12-07 Thread Duncan Murdoch
R-help is the wrong list for questions about developing packages. I'll send a reply to you and to R-package-devel, which is the right list. Duncan Murdoch On 07/12/2017 4:43 AM, Pijush Das wrote: Hello Sir, I have been trying to create a package in R. When I have put the check option

Re: [R] difference between ifelse and if...else?

2017-12-13 Thread Duncan Murdoch
if" explains it pretty clearly. Think of ifelse() as a function with vector inputs and a vector output, and if() as a flow control construction. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat

Re: [R] change in behavior of c.trellis

2017-12-14 Thread Duncan Murdoch
names(formals(obj1$prepanel { But obj1$prepanel is NULL in your test case. NULL is not a legal argument to formals(), and it now warns about it. Duncan Murdoch On 14/12/2017 1:12 AM, Richard M. Heiberger wrote: library(latticeExtra) Loading required package: lattice Loading requi

Re: [R] something weird has happened....!!!!!!!!!!

2017-12-15 Thread Duncan Murdoch
producing two vectors. But in what way do they differ? I looked at 3 entries, and they were identical. Duncan Murdoch Also one of my function returns negative values, even after double checking the code, which should return only positive values.. Whats wrong..? Reinstall R? Thank

Re: [R] Generating help files for a function

2017-12-16 Thread Duncan Murdoch
again. The first two steps are particularly easy in RStudio: for 1, just click "Install and restart" in the build pane, and for 2, navigate in the file pane to the man directory, and choose "Set as working directory" from the "More" tab. Duncan Murdoch

Re: [R] Help with first S3-class

2018-01-02 Thread Duncan Murdoch
e"-list called another function. Eg. How can account$plot() call account$pastSaldo() ? There's no particular support for having them see each other the way you've defined them. A better way to define them would be as local functions within the account body; then they'd be

Re: [R] shading (fill) the area between two lines

2018-01-11 Thread Duncan Murdoch
On 11/01/2018 7:43 PM, AbouEl-Makarim Aboueissa wrote: Dear All: I am trying to shade the area between the two lines; *line 1* and *line 2*. The help page for polygon() gives some examples of this. Duncan Murdoch You can use this code as an example. x100<-c(-1,1,2,3,4,5,6,3) y100

Re: [R] Help with packages (methods, stats, stats4)

2018-01-12 Thread Duncan Murdoch
g all of R. Duncan Murdoch when i tried the following command : *library(help = "stats") * , it gave me this output (*see picture*), so i contacted the Maintainer of the package at (*r-c...@r-project.org *) but he said that i write to the wrong place. (i want to install those packages

Re: [R] Help with packages (methods, stats, stats4)

2018-01-12 Thread Duncan Murdoch
On 12/01/2018 1:11 PM, Karim Mezhoud wrote: Hi, Did you try install.packages('stats'). That will not work, as stats is a base package. It comes with R, and can't be changed. The stats package should never be missing in a proper install of R. Duncan Murdoch Let we

Re: [R] Help with packages (methods, stats, stats4)

2018-01-12 Thread Duncan Murdoch
kages("devtools") # if not already installed... devtools::install_github("USGS-R/DVstats") but that fails for me, with this message: ERROR: dependencies ‘smwrBase’, ‘smwrGraphs’, ‘smwrStats’, ‘smwrQW’ are not available for package ‘DVstats’ It doesn't look promising.

Re: [R] Merging RData files

2018-01-16 Thread Duncan Murdoch
both of them, produce the object you want to save, and save it. If some objects have the same names in both files, do this carefully: the second load will overwrite the first one. A safe way to do it is described here: https://www.r-bloggers.com/safe-loading-of-rdata-files-2/ Duncan Murdoch

Re: [R] Merging RData files

2018-01-16 Thread Duncan Murdoch
ot;ab.RData") because the second saved image overwrites the first one. It'll be okay if all the variable names are different in a.RData and b.RData, but will lose values from a.RData if any of them have the same names as objects in b.RData. See the link I posted earlier to avoid t

Re: [R] Merging RData files

2018-01-16 Thread Duncan Murdoch
. Those functions are similar to save/load, but they only write a single variable and don't write variable names, so you can do things like saveRDS(x, "x.rds") y <- readRDS("x.rds") to read the value of x directly into y. Duncan Murdoch On 1/16/2018 8:06 PM, Dun

Re: [R] roxygen2 error - x$tag operator is invalid for atomic vectors

2018-01-17 Thread Duncan Murdoch
ode is being found. The output might not mean much to you, but perhaps others here will spot the issue. If that doesn't make the problem obvious, then post a link to your Github source and someone else will be able to try it. Duncan Murdoch __ R-

Re: [R] setSessionLimit

2018-01-19 Thread Duncan Murdoch
help page, you'll see that it also documents setSessionTimeLimit. 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-p

Re: [R] a vector unusually getting NA values.....

2018-01-20 Thread Duncan Murdoch
values of j for which the condition is false, k is getting populated by NA values. k is getting the following values (for a given snl): Try this: k <- 1 k[5] <- 5 k and you should see what's happening. Duncan Murdoch k [1]1 NA NA NA 5 6 NA NA 9 10 11 NA NA NA NA 16

Re: [R] Portable R in zip file for Windows

2018-01-26 Thread Duncan Murdoch
ogether a way to run R despite security policies that forbid it. And nothing to stop them from inserting their own malicious code into the .zip file. Duncan Murdoch On Fri, Jan 26, 2018, 00:49 Gabor Grothendieck wrote: Can you clarify what the nature of the security restriction is? If you can&

Re: [R] When was the script editor introduced in Rgui for windows?

2018-01-26 Thread Duncan Murdoch
CHANGES file is only linked into the help system on Windows. Since R 2.15.0 Windows changes are announced in the same file(s) as other changes.) The CHANGES entry was - Added Rgui script editor by Chris Jackson. This happened in svn revision 28991, which I committed in April, 2004. Duncan

Re: [R] command line fails

2018-02-02 Thread Duncan Murdoch
ape that space, but I can't remember what the escape sequence is. (Escapes in Windows can be processed by the command shell or Rscript.exe or both, so it's hard to get them right.) Another alternative might be to change directory to that path and then use a relative path for the R script

Re: [R] command line fails

2018-02-02 Thread Duncan Murdoch
ouldn't take long to find the offending line by bisection: comment out the last half of the script, if it works, that's where the problem is, so comment only the last quarter, etc. Duncan Murdoch Michael Ashton, CFA Managing Principal Enduring Investments LLC W: 973.457.4602 C

Re: [R] Include pre-existing PDF files as vignettes in an R package?

2018-02-19 Thread Duncan Murdoch
arkdown process. (Not to mention that such an approach would be fragile at best.) You don't say what format the source is, but if it is LaTeX, you just need to add some comments at the beginning, rename ending in .Rnw, and R will recognize plain LaTeX files as Sweave vignettes. See t

Re: [R] Include pre-existing PDF files as vignettes in an R package?

2018-02-19 Thread Duncan Murdoch
at you'll need to edit it for all vignettes, not just the strange ones. Duncan Murdoch -- Mike On Mon, Feb 19, 2018 at 1:20 AM, Duncan Murdoch wrote: On 18/02/2018 9:06 PM, Michael Hannon wrote: Greetings. The group that I work with has just started using the approach outlined in K

Re: [R] deparseDots to get names of all arguments?

2018-02-20 Thread Duncan Murdoch
ns in ..., not their names. I think base R doesn't have a way to do this (but I may be wrong). You can do it using some the rlang package. For example, this seems to work: deparseDots <- function(...) { unname(sapply(rlang::exprs(...), deparse)) } Duncan Murdoch ___

Re: [R] Checking for a proper "stop" statement...

2018-02-21 Thread Duncan Murdoch
2 $ message: chr "could not find function \"notgood\"" $ call : language notgood() - attr(*, "class")= chr [1:3] "simpleError" "error" "condition" so you could write a test based on the message, or based on the call to see where the

Re: [R] include

2018-02-24 Thread Duncan Murdoch
Of course, in this example, x1 is 0, so it gives the same answer. Duncan Murdoch Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Feb 24, 2018 at 9:59 AM, Val wrote: Thank you Jim I wanted a final data frame after replacing the NA's to "0" x1 = rbind(unique(preval),m

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Duncan Murdoch
h* the true and false values, and then selects entries from each. Just use an if statement. 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] Random Seed Location

2018-03-04 Thread Duncan Murdoch
ler") > rnorm(1) [1] -0.1613431 > save <- .Random.seed > rnorm(1) [1] 0.6706031 > .Random.seed <- save > rnorm(1) [1] -0.4194403 If .Random.seed were the complete state, the 2nd and 3rd rnorm results would be the same. Duncan Murdoch /Henrik On Sun, Mar 4, 2018 at 1

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Duncan Murdoch
page, or read its Description carefully (where "all" is used in the technical sense of the all() function), ignoring the final few words which seem to suggest that c(TRUE, TRUE) is not okay. Duncan Murdoch So you have already violated that specific warning, which led to the confus

Re: [R] Documenting R package with Rd file

2018-03-14 Thread Duncan Murdoch
) m<-mmat(x) uhat<-m%*%y Should be "uhat <- m \%*\% y" Duncan Murdoch dstat(uhat) }  -- st...@ntu.edu.tw (S.T. Yen) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, se

Re: [R] Learning advanced R

2018-03-14 Thread Duncan Murdoch
actor. I'm all for learning more languages and using the one that's best for each job, but for people who don't know Python, it would be helpful to list the aspects in which it excels. When should an R user choose to write something in Python instead? Duncan Murdoch _

Re: [R] Problem with reading data from an UTF-16 database

2018-03-14 Thread Duncan Murdoch
onnect function. So maybe you could use that instead of DBI and odbc. Duncan Murdoch Best regards, Thierry library(DBI) con <- dbConnect(odbc::odbc(), .connection_string = "Driver=the_drive;Server=our_server;Database=the_database;Trusted_Connection=Yes;") dbGetQuery(con, sql_sta

Re: [R] R project global options file

2018-03-17 Thread Duncan Murdoch
x27;t know if it would for Adrian. Duncan Murdoch Cheers, Adrian Adrian Friskin | Senior Technology Support Officer | Learning Environments - Labs Team | Learning Environments and Technology Services | Queensland University of Technology | Synergy Building Level 3 - LETS, 88 Musk Aven

Re: [R] How to take difference of sets when there is an empty subset involved

2018-03-18 Thread Duncan Murdoch
quot;P1", "P2", "P3", "P4"}} set_symdiff(A,i) Output: {{}, {"P1", "P2", "P3", "P4"}} i also tried with set_complement() .But it does not subtract the empty subset from the bigger set. It seems it doesn't recognise it.

Re: [R] R 3.4.4, internet access fails on Windows XP

2018-03-21 Thread Duncan Murdoch
ent windows version") The Windows FAQ 2.2 says, "Windows XP is no longer supported", so I think you're out of luck. XP went past "end-of-life" in 2014. Other than switching to a more recent Windows version, your choices are switching to a completely different OS, o

Re: [R] Sum of columns of a data frame equal to NA when all the elements are NA

2018-03-21 Thread Duncan Murdoch
ums...)? or an equivalent function? Something like apply(df[,c("A", "B")], 1, function(x) if (all(is.na(x))) NA else sum(x, na.rm = TRUE)) should do what you want. Duncan Murdoch Thank you for your help Stefano (oo) --oOO--( )--OOo---

Re: [R] R 3.4.4, internet access fails on Windows XP

2018-03-22 Thread Duncan Murdoch
On 22/03/2018 5:28 AM, Holger Taschenberger wrote: Dear Duncan, thank you for your reply. On Wed, 21 Mar 2018 11:58:15 -0400 Duncan Murdoch wrote: The Windows FAQ 2.2 says, "Windows XP is no longer supported", so I think you're out of luck. XP went past "

Re: [R] can not install package "matie"

2018-03-28 Thread Duncan Murdoch
'matie' package depends on 'proxy', and 'proxy' depends on R version 3.4.0 or more. You could try installing 'proxy' using install.pacakges("proxy"), but I'm guessing it will fail unless you update your R version first. Duncan Murdoch

Re: [R] Fast tau-estimator line does ot appear on the plot

2018-03-31 Thread Duncan Murdoch
(RobPer) FastTau(Z,Y) fast=FastTau(Z,Y) abline(fast, col="yellow") abline() doesn't know what to do with the "fast" object. It isn't a vector containing intercept and slope, it's a list containing them. So you'll need something like abline(unlist(fa

Re: [R] about family=binomial in glm funtion

2018-04-14 Thread Duncan Murdoch
esn't give the answer, but it links to ?family, which does. Duncan Murdoch What is the difference between these cases ? For my opinion the first one is a logit model, and second one is a binomial probability model , right? Many thanks. [[alternative HTML versi

Re: [R] Adding a new conditional column to a list of dataframes

2018-04-15 Thread Duncan Murdoch
please let me know my mistake and how to correct my syntax ? Your function should return x after modifying it. As it is, it returns the value of x$NewCol [ x[ ,3] < x[ 1,2] ] <- "C", which is "C". So change it to MyFunction <- function(x) { x$NewCol [ x[ ,3]

Re: [R] Package 'data.table' in version R-3.5.0 not successfully being installed

2018-04-26 Thread Duncan Murdoch
and may have fixed the errors, but that would require an installation from source, which not every Windows user is comfortable with. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/list

Re: [R] Package 'data.table' in version R-3.5.0 not successfully being installed

2018-04-26 Thread Duncan Murdoch
On 26/04/2018 1:54 PM, Akhilesh Singh wrote: My thanks to Dr. John Fox and Dr. Duncan Murdoch. But, I have upgraded all my R-3.4.3 libraries to R-3.5.0, and I have not backed-up copies of old version. So, I would give a try each to the solutions suggested by John Fox and Dengan Murdoch. Here

Re: [R] Package 'data.table' in version R-3.5.0 not successfully being installed

2018-04-27 Thread Duncan Murdoch
ibed. If people just run the installer and accept the defaults, it works. Don't trust bloggers, trust CRAN. 2. data.table fails its self-tests in 3.5.0, as shown on CRAN. Apparently fixes are in the works, but being able to install it doesn't mean it will work properly.

Re: [R] The stages of standard function evaluation

2018-05-03 Thread Duncan Murdoch
evaluation is whether the function looks at the expression in promises, or only looks at the value when it is evaluated. substitute() is the usual way to look at the expression, but packages like rlang define others. Other issues that you haven't touched on that probably belong in a

Re: [R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

2018-05-04 Thread Duncan Murdoch
png() or pdf() instead of the default device. Duncan Murdoch Could you tell me how to produce a graphic divice with correct size that I set? I need this function because the graphic divice cannot accomendate all of the graph I make with some of plot tools such as ggtree. In ggtree plot, p

Re: [R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

2018-05-05 Thread Duncan Murdoch
on't fit, then you might get a smaller one, and you'll need to choose a non-screen device such as png() or pdf() instead of the default device. Duncan Murdoch   Could you tell me how to produce a graphic divice with correct size that I set? I need this function because the graphic divice 

Re: [R] Package parallel missing from CRAN_package_db

2018-05-09 Thread Duncan Murdoch
only when R is updated. You can't install it from CRAN unless you install all of R. 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 guid

Re: [R] is there any method to defer the execution of code in r?

2018-05-13 Thread Duncan Murdoch
on that you see). Since he has more reputation points, he gets to moderate decisions like that, and can perhaps undo them. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Installing an Archived Package

2018-05-16 Thread Duncan Murdoch
ode I tried to install the package from the archive and the errors I received: install.packages("/polycor_0.7-8.tar", repos=NULL, type="source") Warning: invalid package ‘/polycor_0.7-8.tar’ As Michael said, you shouldn't unpack the tar.gz file. Duncan Murdoch Error: E

Re: [R] Installing an Archived Package

2018-05-16 Thread Duncan Murdoch
d from CRAN. It's unfortunate that install.packages() doesn't do this automatically when you install a tar.gz file, but that's the way it is. Duncan Murdoch Warning message: In install.packages("polycor_0.7-8.tar.gz", repos = NULL, type = "source") : instal

Re: [R] Scale

2018-05-20 Thread Duncan Murdoch
my code: plot(survfit(Y~addicts$clinic), fun="cloglog", las=2) Did you try las = 1? That's what the documentation (in ?par) says to do. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.

Re: [R] Can't open R files

2018-05-21 Thread Duncan Murdoch
If you're using Windows, you need to right click on the file, choose "Open with...", then pick RStudio and check the box saying you want to open all files that way. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBS

Re: [R] update.packages() after updating R version

2018-05-26 Thread Duncan Murdoch
version number. But packages installed under R x.y.z are not usable in R x.y+1.w. Duncan Murdoch Alternatively, is there a function I can run that will rebuild all installed packages after I upgrade R versions? Regards, Rich __ R-help@r

Re: [R] Cannot Load A Package

2018-06-01 Thread Duncan Murdoch
ntic Versioning V2.0.0' Parser Perhaps you really want one of those. Duncan Murdoch I tried downloading it from install.packages('semnet',repos='http://cran.us.r-project.org') and install.packages('semnet',repos='http://cran.revolutionanalytics.com/') a

Re: [R] Printing left-justified character strings

2018-06-05 Thread Duncan Murdoch
; "a" "ab" "abc" In a data frame, I do see it right justified: x 1a 2 ab 3 abc etc. It is easy to change the printing of data frames: print.data.frame <- function(x, ..., right = FALSE) { base::print.data.frame(x, ..., right = right) } > data.frame(x

Re: [R] Printing left-justified character strings

2018-06-05 Thread Duncan Murdoch
On 05/06/2018 7:49 PM, zListserv wrote: p.s. It seems to work for print command, but not for head, tail, or printing a data frame, per below. Any way fix the others so they all left-justify? You haven't shown us what you did. Duncan Murdoch ___

Re: [R] Printing left-justified character strings

2018-06-06 Thread Duncan Murdoch
ab 6 abc I don't get that, because I didn't redefine the generic, only the methods. R> x rep(c("a", "ab", "abc"), 7) 1a 2 ab 3

Re: [R] Issues when Trying to Install Packages in R

2018-06-11 Thread Duncan Murdoch
nyone know how to solve this problem? You need to install the stringi package first. Normally that is done automatically, but sometimes suitable versions are not available, and it needs to be done manually. Duncan Murdoch __ R-help@r-project.o

Re: [R] Tables in Rmarkdown Word

2018-06-13 Thread Duncan Murdoch
know the answer to this question. Others like it tend to appear on Stack Overflow with the "knitr" tag, so that might be a better place to ask if no answer appears here. But like here, that forum asks for reproducible examples (i.e. the R code that doesn't quite work). Dunca

Re: [R] interpret a p-value result as a significance of a linear regression in terms of sigmas

2018-06-20 Thread Duncan Murdoch
at you want, but I think you'll have to ask your supervisor for the definition used in your area. Duncan Murdoch My question is, am I right if I state that the significance in terms of sigmas (sign) is given by: p = 2*(1-pnorm(sign)) since I guess the p-value returned by R is for a two side

Re: [R] OT --- grammar.

2018-06-24 Thread Duncan Murdoch
I would like to call upon the collective wisdom of the R community to help me decide. Thanks, and my apologies for the off-topic post. I'd agree with you: "are". Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo

Re: [R] Problems with 3.5.0 package installation & knitr

2018-06-25 Thread Duncan Murdoch
to R-devel yesterday, and got a response asking you some questions about your setup. 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] Plot Rect Transparency

2018-06-28 Thread Duncan Murdoch
, 350, density = 5, border = rgb("red") rect(110, 300, 175, 350, density = 5, border = rgb(red=1, green=0, blue=0, alpha=0.1)) I'm not sure what is the quickest way to work out the rgb values for a named colour (col2rgb can do it, but not in a con

Re: [R] Generate random Bernoulli draws

2018-07-06 Thread Duncan Murdoch
ld be much better to write x <- runif(N, 0, 2) rbinom(N, 1, 1 - exp(-2.5*x)) because it is so much more clearly related to the original problem statement. Perhaps it would be a few microseconds slower, but that would be saved many times over when any aspect of the problem statement was modified

Re: [R] Package installation

2018-07-09 Thread Duncan Murdoch
ably may need to set .libPaths() explicitly to see them. To check for this, print .libPaths() just after installing the packages, and again when starting a new session. If the printed list of paths is different, you'll have problems. Duncan Murdoch __

Re: [R] Generate N random numbers with a given probability and condition

2018-07-11 Thread Duncan Murdoch
un for a satisfactory sample, and how correlated later draws will be. Propp and Wilson's perfect sampling algorithm might allow an exact draw, though I don't quite see how, and I'm not sure it would be worth the trouble. Just run for a few thousand steps and

Re: [R] Simplify the loop over the 3rd dimension of a 3D array

2018-07-12 Thread Duncan Murdoch
time_seq) - 1)){ tab[time + 1,,] <- t(matrix(round(runif(ind, 0, 100)), ind, 9)) } And then you can do away with the loop entirely, since none of the values depend on earlier calculations. Just generate ind*length(time_seq) uniforms, and put them in the array in the right order. You could

Re: [R] undo compile? (or: remove bytecode from closure)

2018-07-16 Thread Duncan Murdoch
hose, you need more steps: f <- fc body(f) <- body(f) attr(f, "srcref") <- getSrcref(fc) Duncan Murdoch f #function (x) #{ # x <- x + 1 # pi * x #} f(1) #[1] 6.283185 Hope this helps, Rui Barradas Às 03:25 de 16-07-2018, Benjamin Tyner escreveu: Hi Give

Re: [R] Problem with mean()

2018-07-21 Thread Duncan Murdoch
On 21/07/2018 12:39 PM, John Kane via R-help wrote: Either I am doing something very stupid or my R installation has a glitch. What am I missing? dd1  <- 50 dd2  <- 54 mean(dd1, dd2) [1] 50  # wrong Read the help page ?mean. You are specifying the parameters x and trim. Duncan M

Re: [R] what does this syntax mean in R

2017-04-16 Thread Duncan Murdoch
ent **if(TRUE){print("A"))* Because braces don't affect invisibility. Auto-printing ignores objects that are marked as invisible. You would get two lines printed if you asked for explicit printing, e.g. print( if(TRUE){print("A")} ) or remove the invisibility later, e

Re: [R] question about the anova() function for deviance analysis

2017-04-17 Thread Duncan Murdoch
better, but it should be code that anyone can run. 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] Fwd: Re: Setting .Rprofile for RStudio on a Windows 7 x64bit / Windows file extension hiding

2017-04-18 Thread Duncan Murdoch
This page tells how to disable it there: https://support.apple.com/kb/ph19072?locale=en_US There's little point providing a link to a Microsoft page for doing this on Windows, because their help page links are not very durable. The main one that Google finds describes itself as obsole

Re: [R] Is there a way to open R terminal running in the background

2017-04-19 Thread Duncan Murdoch
using: CreateObject("Wscript.Shell").Run R.exe CMD BATCH MyGUI.R , 0, TRUE I think this is more of a Microsoft question than anything specific to R. How do you ask VBS to show you a process that it is running? No idea where to go with VBS questions. Duncan Murdoch 2) for the

Re: [R] Is there a way to open R terminal running in the background

2017-04-19 Thread Duncan Murdoch
I think it really is the higher level thing (VBS in your case, cmd.exe if you run that at a prompt) that might have the ability to do what you want. Duncan Murdoch Thank you for your time. On Wed, Apr 19, 2017 at 12:14 PM, Duncan Murdoch mailto:murdoch.dun...@gmail.com>> wrote: On

Re: [R] Looking for a package to replace xtable

2017-04-20 Thread Duncan Murdoch
lexible (though maybe harder to use) than xtable. I can't look at it now, but will try to remember to do so in a few hours if I don't see a better solution posted first. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBS

Re: [R] Creating interactive graphs and exporting to Intranet site

2017-04-23 Thread Duncan Murdoch
easy to do using Shiny or RStudio Connect (a paid service, see https://www.rstudio.com/products/connect/), which could run on your own server. So I'd try to relax your constraints. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUB

Re: [R] R Date Time

2017-04-25 Thread Duncan Murdoch
sure whether you are using MDY or DMY; I used DMY): strptime("01-01-2016T14:02:23.325", format="%d-%m-%YT%H:%M:%OS") Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] R Date Time

2017-04-25 Thread Duncan Murdoch
derings in dates? Doesn't matter for this example, but it would for "01-02-2016T14:02:23.325" 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 t

Re: [R] survival package can't find Ccoxfit6

2017-04-26 Thread Duncan Murdoch
survival saved in their workspace, and are using that one instead of the current one. - Some part of your code returns functions, and one of those is making this call based on an object produced in an earlier version of survival. - There are really two versions of survival on the search path (or

  1   2   3   4   5   6   7   8   9   10   >