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

Re: [R] Installation Re: Problems with library...

2018-12-24 Thread Duncan Murdoch
around 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 guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] convert columns of dataframe to same factor levels

2018-12-19 Thread Duncan Murdoch
els this way: levels> f <- factor(c("a","b")) levels> levels(f) <- c("c", "a", "b") levels> f [1] c a Levels: c a b levels> f <- factor(c("a","b")) levels> levels(f) <- list(C = "C", A =

Re: [R] convert columns of dataframe to same factor levels

2018-12-19 Thread Duncan Murdoch
ot;,"D": 1 1 2 2 1 Thank you I don't think read.table() can do it for you automatically. To do it yourself, you need to get a vector of the levels. If you know this, just assign it to a variable; if you don't know it, compute it as thelevels <- unique(unlist(lapply(my.data, lev

Re: [R] RTerm.exe

2018-12-17 Thread Duncan Murdoch
les\R\R-3.5.1\bin\x64\Rgui.exe" Not sure what your question is, but the executable is called Rterm.exe, and should be in the same directory as Rgui.exe. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] error = FALSE causes knit2wp to throw duplicate label error

2018-12-16 Thread Duncan Murdoch
n't know if Yihui reads this list; you'd probably be better off on StackOverflow or filing an issue as described at https://yihui.name/knitr/faq/. Duncan Murdoch My code: ```{r setup, include=FALSE} ## Set the global chunk options for knitting reports knitr::opts_chunk$set( echo = T

Re: [R] Width of a text

2018-12-12 Thread Duncan Murdoch
to do it here: <https://shiny.rstudio.com/articles/js-send-message.html>. Duncan Murdoch Thanks for any input. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] Bug (?): reading binary files in Windows 10

2018-12-06 Thread Duncan Murdoch
ed to be a text file, and LF is changed to CR LF. There may also be handling of EOF marks, I forget. 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] (no subject)

2018-12-02 Thread Duncan Murdoch
at version? What locale? 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 commente

Re: [R] why the base::round(0.015, 2) returns 0.02?

2018-11-28 Thread Duncan Murdoch
0, you get the exactly correct result. Then the apparent rule for round(x, 2) is: multiply by 100, round to an integer, divide by 100. Duncan Murdoch Therefore, according to the arithmetic rules, rounded 0.014 to the second digit is 0.01. Also, the round() function in other programming languag

Re: [R] [R ]Exporting rgl.snapshot and rgl.postscript

2018-11-27 Thread Duncan Murdoch
unctions like open3d(), not the low-level rgl.* functions like rgl.open().) The rgl.postscript() display is limited by what the GL2PS library can do, so if it doesn't do what you want, there's not much you can do to improve it. Duncan Murdoch Can somebody please show me how to properly

Re: [R] Perspective Plotting - 3D Plotting in R

2018-11-26 Thread Duncan Murdoch
uld contain the values of the two factors to your model that you are holding fixed while plotting the two that are not fixed. This Stackoverflow answer https://stackoverflow.com/questions/53349811/how-to-draw-a-response-surface-plot-for-three-factorial-design/53350259#53350259 describes a way to

Re: [R] which element is duplicated?

2018-11-13 Thread Duncan Murdoch
's vectors package is addressing? I don't know; hopefully someone else will respond... Duncan Murdoch Bill Dunlap TIBCO Software wdunlap tibco.com <http://tibco.com> On Tue, Nov 13, 2018 at 2:15 AM, Duncan Murdoch mailto:murdoch.dun...@gmail.com>> wrote: On 13/11/2018 12:35

Re: [R] which element is duplicated?

2018-11-13 Thread Duncan Murdoch
On 13/11/2018 12:35 AM, Pages, Herve wrote: Hi, On 11/12/18 17:08, Duncan Murdoch wrote: The duplicated() function gives TRUE if an item in a vector (or row in a matrix, etc.) is a duplicate of an earlier item.  But what I would like to know is which item does it duplicate? For example, v

[R] which element is duplicated?

2018-11-12 Thread Duncan Murdoch
s [1] FALSE FALSE TRUE TRUE What I want is a fast way to calculate [1] NA NA 2 1 or (equally useful to me) [1] 1 2 2 1 The result should have the property that if result[i] == j, then v[i] == v[j], at least for i != j. Does this already exist somewhe

Re: [R] Question about function scope

2018-10-30 Thread Duncan Murdoch
"y"]] z <- result[["z"]] Duncan Murdoch - Original Message - From: "Duncan Murdoch" To: "Sebastien Bihorel" , r-help@r-project.org Sent: Tuesday, October 30, 2018 4:13:05 PM Subject: Re: [R] Question about function scope On 30/10/2018 3:5

Re: [R] Question about function scope

2018-10-30 Thread Duncan Murdoch
ronment()) if (c==2) bar2(environment()) # some more code cat(sprintf('foo: x=%d, y=%d, z=%d\n', x, y, z)) } foo(c=0) foo(c=1) foo(c=2) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] Question about function scope

2018-10-30 Thread Duncan Murdoch
bar1() if (c==2) bar2() # some more code cat(sprintf('foo: x=%d, y=%d, z=%d\n', x, y, z)) } foo(c=0) foo(c=1) foo(c=2) I get this output: > foo(c=0) foo: x=0, y=0, z=0 > foo(c=1) bar1: x=1, y=1, z=1 foo: x=1, y=1, z=1 > foo(c=2) bar2: x=2, y=2, z=2 foo: x=2, y=2, z=2 Duncan Mu

Re: [R] source() fails in same directory as script: cannot find file

2018-10-27 Thread Duncan Murdoch
why others didn't Duncan Murdoch On October 26, 2018 1:11:19 PM PDT, Jeremie Juste wrote: Hello, I suspect the error is in the file input-summerize.R. I creating a new file input-summerize2.R with only print("hello") for instance and check if setwd("~/documen

Re: [R] GLM Model Summary

2018-10-16 Thread Duncan Murdoch
. Is that what you meant? What would probably be best is if you showed us a simple example of what you are doing, and then referred to the results from that when saying what you want to extract. Duncan Murdoch We therefore ask, is it possible for us to get the Summary(Model) column by column, i.e

Re: [R] RMarkdown vignettes v. Jupyter notebooks?

2018-10-11 Thread Duncan Murdoch
/content/2671/Combining-Shiny-R-Markdown.html>. Other than my two notes above, your comments about Rmarkdown seem right on the mark. Duncan Murdoch I'm trying to do real time monitoring of the broadcast quality of a radio station, and it seems to me that it may be easier to do tha

Re: [R] Genuine relative paths with R

2018-10-11 Thread Duncan Murdoch
On 10/10/2018 8:08 PM, Olivier GIVAUDAN wrote: I think Gabor (at least) already suggested this solution. But the problem is: how do you source this file containing this 'foo' function without writing its absolute path? You only need its relative path to source it. Duncan Murdoch It's

Re: [R] Reorder file names read by list.files function

2018-10-10 Thread Duncan Murdoch
of filenames. Duncan Murdoch I have not tried RUI's yet, but i will if nothing else works out. Thanks again--EK had to strip off file.names from the extension PDF, but when i paste the month.name with .PDF to get the correct file names, i am getting the same error. On Tue, Oct 9, 2018 at 4:47 PM

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
using fooline <- getSrcLocation(foo) This is a lot like __LINE__ in C. Duncan Murdoch 'getwd()' is indeed not equivalent to VBA 'Application.ThisWorkbook.Path' or C macro '__FILE__' or SAS %sysget(SAS_EXECFILENAME), etc. ---

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
LaTeX, SAS with macro-variables, etc.)?" Duncan Murdoch ---- *De :* Duncan Murdoch *Envoyé :* mercredi 10 octobre 2018 22:31 *À :* Olivier GIVAUDAN; Jeff Newmiller *Cc :* r-help@r-project.org *Objet :* Re: [R] Genuine rela

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
be a good idea, if you know the system very, very well. Otherwise, it's probably better to work the standard way. Duncan Murdoch For example, you might thinkthat all front ends set the working directory to the directory of theprogram they are running, because the ones you've tried do

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
are running, because the ones you've tried do it that way. But they don't. Duncan Murdoch ---- *De :* Duncan Murdoch *Envoyé :* mercredi 10 octobre 2018 21:39 *À :* Olivier GIVAUDAN; Jeff Newmiller *Cc :* r-help@r-project.org *Obje

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
, if you are distributing R code, you should do it in the standard way, not invent your own. Duncan Murdoch *De :* Duncan Murdoch *Envoyé :* mercredi 10 octobre 2018 20:54 *À :* Olivier GIVAUDAN; Jeff Newmiller *Cc :* r-help@r

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
he package is installed, those files will be moved up one level, i.e. Olivier/inst/foo will become system.file("foo", package = "Olivier") Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
are seeing anything different from that on a Unix-alike. Duncan Muroch ---- *De :* Duncan Murdoch *Envoyé :* mercredi 10 octobre 2018 15:20 *À :* Olivier GIVAUDAN; Jeff Newmiller *Cc :* r-help@r-project.org *Objet :* Re:

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
On 10/10/2018 11:20 AM, Duncan Murdoch wrote: On 10/10/2018 11:18 AM, Olivier GIVAUDAN wrote: Hi Duncan, Yes, if you need to display the content of $PWD you obviously need to type 'echo' before this variable. It prints the user's working directory if run from a terminal but if run from a bash

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
of the script. At least for me (I am running on the last version of Ubuntu)... Not for me. Always prints the user's working directory. Duncan Murdoch Best regards, Olivier *De :* Duncan Murdoch *Envoyé :* mercredi 10

Re: [R] Genuine relative paths with R

2018-10-10 Thread Duncan Murdoch
ot;echo" ahead of that, and it would print the user's working directory, not the working directory of the script. Duncan Murdoch ​ __FILE__ in C relates to the source code directory that is usually not where the executable is ​located and may not even exist on the computer it is running on​ ​ Yes, an

Re: [R] how to pass arguments to panel.cor in pairs()

2018-10-09 Thread Duncan Murdoch
nt the regular one sometimes and a custom one other times, you could make your own panel function: panel.cor2 <- function(...) panel.cor(..., prefix = "r = ") Then use pairs(USJudgeRatings, lower.panel = panel.smooth, upper.panel = panel.cor2, gap=0, row1attop=FALSE) Duncan Mur

Re: [R] using S4 objects in "with"?

2018-09-26 Thread Duncan Murdoch
his is an undocumented implementation detail, and you aren't supposed to count on it. 2. You could write an as.list() method for the Wave class, then with(as.list(Wobj), would work. This may be the "right" way to do this. Duncan Murdoch _

Re: [R] Summarizing R script

2018-09-26 Thread Duncan Murdoch
ough for submission there enforces some good coding and documentation practices. Duncan Murdoch   And there are publications like "R Journal" that are looking for descriptions of what you've done.  I have a paper in "R Journal" describing the "sos" package;  that ar

Re: [R] For Loop

2018-09-23 Thread Duncan Murdoch
"try it and see". Sometimes it probably helps a lot, sometimes it's probably detrimental. Duncan Murdoch P.S. I last worked in a corporate computing environment 40 years ago when I was still wet behind the ears, so you'd probably want to ask someone else. However, more recentl

Re: [R] For Loop

2018-09-23 Thread Duncan Murdoch
nction so it acts as if it is vectorized. The "performance penalty" part of your statement is true. It will generally save some computing cycles to write a new function using a for loop instead of using Vectorize(). But that may waste some programmer time. Duncan Murdoch (writing a

Re: [R] For Loop

2018-09-23 Thread Duncan Murdoch
. It is very similar to (but probably a little faster than) log(c1[2:len]/c1[1:(len-1)]) There are differences in borderline cases (like length(c1) != len, or len < 2) that are not relevant in the original context. Duncan Murdoch Thank you, John John David Sorkin M.D., Ph.D. Profes

Re: [R] Link from vignette to package documentation

2018-09-22 Thread Duncan Murdoch
On 22/09/2018 4:14 AM, Martin Maechler wrote: Duncan Murdoch on Fri, 21 Sep 2018 05:02:32 -0400 writes: > On 21/09/2018 4:54 AM, Sigbert Klinke wrote: >> Hi, >> >> is it possible to make a link from a vignette to a (Rd) >> help files

Re: [R] Link from vignette to package documentation

2018-09-21 Thread Duncan Murdoch
to make the URL predictable, either by something like options(help.ports = 12345) (which will put help on port 12345, blocking that port for any other use, including help in another R session), or by putting a static copy of the help pages on some other web server. Duncan Murdoch

Re: [R] YAML for bookdown

2018-09-12 Thread Duncan Murdoch
re exactly the arguments to the bookdown::gitbook function. It passes ... to rmarkdown::html_document, so those arguments are available too. If you're using a different bookdown output format, the allowed entries will be the arguments to whatever function you use. Dunc

Re: [R] getting 21 very different colours

2018-09-11 Thread Duncan Murdoch
other characteristics as well, such as the symbol. You could plot 21 different letters in 5 different colours and it might work, but it's not going to be easy for viewers. Duncan Murdoch I could pick them by hand, but that is about 15 colours more than I know (I have a detailed colourchart

Re: [R] argument "string" is missing, with no default

2018-09-08 Thread Duncan Murdoch
Thank you. Use traceback() to see which function called stri_split_regex. Break up the long pipeline into smaller parts so you can see where the error is comming from. Don't post in HTML. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] frequency distribution in figures....

2018-09-08 Thread Duncan Murdoch
y(xhth) You could use table(cut(xht, breaks=2*(0:5))) which produces (0,2] (2,4] (4,6] (6,8] (8,10] 2 2 2 2 2 for your dataset. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Casting Date to char

2018-09-05 Thread Duncan Murdoch
might just be a typo in your message, but as.character() is the function you want, not as.Character(). The other typo or error above is that you are trying to convert dp$sampdate, but the dataframe has no column with that name according to the lines above. Duncan Murdoch I don't understand the error

Re: [R] Plots in ioslides and R markdown

2018-08-26 Thread Duncan Murdoch
On 26/08/2018 4:40 AM, Patrick Connolly wrote: On Sat, 25-Aug-2018 at 08:10PM -0400, Duncan Murdoch wrote: |> On 25/08/2018 7:37 PM, Patrick Connolly wrote: |> >On Sat, 25-Aug-2018 at 07:53AM -0400, Duncan Murdoch wrote: |> > |> >|> On 25/08/2018 6:21 AM

Re: [R] Multiple counters in a single for loop

2018-08-26 Thread Duncan Murdoch
On 26/08/2018 3:10 AM, Jeremie Juste wrote: Duncan Murdoch writes: for ( i in 1:length(var1)){ This is generally a bad idea: if length(var1) == 0, it does the wrong thing, since 1:0 is c(1L, 0L). Better to use for ( i in seq_along(var1) ) { granted. One should check the validity

Re: [R] Plots in ioslides and R markdown

2018-08-25 Thread Duncan Murdoch
On 25/08/2018 7:37 PM, Patrick Connolly wrote: On Sat, 25-Aug-2018 at 07:53AM -0400, Duncan Murdoch wrote: |> On 25/08/2018 6:21 AM, Patrick Connolly wrote: |> >--- |> >title: "Barking up the wrong tree" |> >author: "Patrick Connolly" |> >

Re: [R] Multiple counters in a single for loop

2018-08-25 Thread Duncan Murdoch
). Better to use for ( i in seq_along(var1) ) { Duncan Murdoch elem1 <-var1[i] elem2 <- var2[i] } if you want more abstraction you could then wrap that up in a function HTHOn 25 Aug 2018 18:57, Jeff Newmiller wrote: look at the map2 function in the purrr package. On August 24, 201

Re: [R] Plots in ioslides and R markdown

2018-08-25 Thread Duncan Murdoch
ault --- ```{r global_options, echo=FALSE} knitr::opts_chunk$set(tidy=TRUE, warning=FALSE, message=FALSE, cache=FALSE, dpi = 300) Drop the dpi setting and it will work fine. Duncan Murdoch

Re: [R] differing behavior of mean(), median() and sd() with na.rm

2018-08-22 Thread Duncan Murdoch
(x)/length(x), so if x is length 0, you get 0/0 which is NaN. median(x) is documented in its help page to give NA for x of length 0. sd(x) is documented to give an error for such x and NA for length 1, but it gives NA for both. Duncan Murdoch x <- c(NA, NA, NA) mean(x, na.rm=TRUE) [1]

Re: [R] source script file that contains Unicode non-English characters

2018-08-17 Thread Duncan Murdoch
not result in any action on it. Posting it to the bug page will at least result in a fairly permanent record. Duncan Murdoch thanks Farid On Sun, Aug 12, 2018 at 9:03 PM, Duncan Murdoch mailto:murdoch.dun...@gmail.com>> wrote: On 12/08/2018 11:48 AM, Faridedin Cheraghi

Re: [R] Spline function

2018-08-14 Thread Duncan Murdoch
interpolator except at observed (x,y) pairs, but will usually be close, especially if the functions are pretty smooth. 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

Re: [R] Mysterious seg fault.

2018-08-12 Thread Duncan Murdoch
segfault. I don't know which report will be more informative. Duncan Murdoch and got a lot of (mysterious to me) output: /usr/local/bin/valgrind R ==18051== Memcheck, a memory error detector ==18051== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==18051== Using Valgrind-3.13.0 an

Re: [R] source script file that contains Unicode non-English characters

2018-08-12 Thread Duncan Murdoch
close() # works fine is a nice way to avoid this problem. Duncan Murdoch R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_Unite

Re: [R] source script file that contains Unicode non-English characters

2018-08-12 Thread Duncan Murdoch
on Windows, in a non-UTF-8 locale? Posting sessionInfo() would be helpful. Duncan Murdoch -Farid On Sun, Aug 12, 2018 at 7:24 AM, Jeff Newmiller wrote: ... and read the Posting Guide... only a few file types will ever make it through the mailing list so repeatedly sending files not among those few

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] undo compile? (or: remove bytecode from closure)

2018-07-16 Thread Duncan Murdoch
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 Given a cl

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

2018-07-12 Thread Duncan Murdoch
th(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] Generate N random numbers with a given probability and condition

2018-07-11 Thread Duncan Murdoch
actory 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 it should be fine. Duncan M

Re: [R] Package installation

2018-07-09 Thread Duncan Murdoch
eed 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 __ R-help@r-p

Re: [R] Generate random Bernoulli draws

2018-07-06 Thread Duncan Murdoch
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. Duncan

Re: [R] Plot Rect Transparency

2018-06-28 Thread Duncan Murdoch
sity = 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 convenient format)

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] OT --- grammar.

2018-06-24 Thread Duncan Murdoch
ar. 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 more, s

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] Tables in Rmarkdown Word

2018-06-13 Thread Duncan Murdoch
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). Duncan Murdoch

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] Printing left-justified character strings

2018-06-06 Thread Duncan Murdoch
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 abc Or that. Duncan Murdoch ___

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 __ R

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.fram

Re: [R] Cannot Load A Package

2018-06-01 Thread Duncan Murdoch
.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/') and even the https://cran.r-project.org/src/contrib/semnet.tar.gz

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] Can't open R files

2018-05-21 Thread Duncan Murdoch
, 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 UNSUBSCRIBE and more, see https://st

Re: [R] Scale

2018-05-20 Thread Duncan Murdoch
is 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.ethz.

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") : installation of packa

Re: [R] Installing an Archived Package

2018-05-16 Thread Duncan Murdoch
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: ERROR:

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

2018-05-13 Thread Duncan Murdoch
o be a duplicate of the older question 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

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 guide htt

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
e length and width aren't the first and second parameters for any device, and length isn't a parameter at all.  Try dev.new(height = 10, width = 10) and you should get a bigger device if it will fit on your screen.  If it won't fit, then you might get a smaller one, and you'll need to choose a non-

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
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 cannot a

Re: [R] The stages of standard function evaluation

2018-05-03 Thread Duncan Murdoch
ction 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 writeup like this are a descriptio

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

2018-04-27 Thread Duncan Murdoch
e 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. Duncan Murdoch Than

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-26 Thread Duncan Murdoch
rs, 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/listinfo/r-help PLEASE do read the

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

2018-04-15 Thread Duncan Murdoch
et 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] < x[ 1,2] ] <

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

2018-04-14 Thread Duncan Murdoch
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 version deleted

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

2018-03-31 Thread Duncan Murdoch
astTau(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(fast), col="yellow"

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

2018-03-28 Thread Duncan Murdoch
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 Here is my sessionInfo sessionInfo() R version 3.3.2 (2016-10-31) Platform:

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 <murdoch.dun...@gmail.com> wrote: The Windows FAQ 2.2 says, "Windows XP is no longer supported", so I think you're out of

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-21 Thread Duncan Murdoch
s 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, or switching to

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

2018-03-18 Thread Duncan Murdoch
;, "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. What else can

Re: [R] R project global options file

2018-03-17 Thread Duncan Murdoch
For me, that choice persists; I don'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

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

2018-03-14 Thread Duncan Murdoch
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_statement) R version 3.4.2 (2017-09-28) P

Re: [R] Learning advanced R

2018-03-14 Thread Duncan Murdoch
rning 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] Documenting R package with Rd file

2018-03-14 Thread Duncan Murdoch
t;-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, see htt

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