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

2017-04-26 Thread Duncan Murdoch
coxfit6 function has never been exported from the survival package. Using unexported internals from a package is very dangerous and likely to lead to errors. (As I pointed out, there were other changes to the call besides the use of "Ccoxfit6" versus Ccoxfit6. Duncan Murdoch

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

2017-04-26 Thread Duncan Murdoch
ph.fit was written, you should copy all of it (including the Ccoxfit6 code), not just part. Or better: work with Dr. Therneau to improve it for everyone. Duncan Murdoch phcoefs(stim[ii], sts[ii], as.matrix(as.double(cvt[ii])), oo$coefficients, control) Error in phcoefs(stim[ii], sts[ii],

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

2017-04-27 Thread Duncan Murdoch
isting functions os is the new model going to hinder it? The new model actually helps in this. It offers the possibility that the run-time code will detect internal changes that break your code, rather than segfaulting when the argument list is wrong. Duncan Murdoch _

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Duncan Murdoch
ople had tested, we might have found it earlier. Duncan Murdoch Best regards, Thierry Op 28 apr. 2017 10:36 a.m. schreef "peter dalgaard" : Yes, we noticed this in the last days of the code freeze before release and shied away from inserting a workaround, partly because we couldn&#

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Duncan Murdoch
ins these pages. Thanks, I missed that update. It is now building 3.4.0-patched, so that version should be available on the mirrors in a few hours. Duncan Murdoch Best, Uwe Thank you! On Fri, Apr 28, 2017 at 7:58 AM, Uwe Ligges mailto:lig...@statistik.tu-dortmund.de>> wrote: On

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

2017-04-28 Thread Duncan Murdoch
On 28/04/2017 5:37 PM, Henric Winell wrote: On 2017-04-26 22:17, Duncan Murdoch wrote: On 26/04/2017 2:51 PM, Therneau, Terry M., Ph.D. wrote: A user contacted me directly about this, I answered with my best understanding of the recent R-help discussion of the issue, and their response to my

Re: [R] Larger rgl-images?

2017-04-28 Thread Duncan Murdoch
on it, then it might work: but I haven't come across a way to do that that also supports OpenGL in the virtual window. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] The effect of tolerance in all.equal()

2017-04-30 Thread Duncan Murdoch
that talk about these things, but I don't know which to recommend. Duncan Murdoch Many thanks, Ashim On Tue, Apr 25, 2017 at 3:14 PM, Martin Maechler wrote: Ashim Kapoor on Tue, 25 Apr 2017 14:02:18 +0530 writes: > Dear all, > I am not able to understand

Re: [R] I cannot run R.EXE or RSCRIPT.EXE

2017-05-05 Thread Duncan Murdoch
hem, which you haven't told us. 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 provid

Re: [R] Copy and Rename Folder in same directory

2017-05-08 Thread Duncan Murdoch
g FALSE where? Does list.of.files look right? If it contains any directories, you'll want "recursive = TRUE" in file.copy(). Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] Copy and Rename Folder in same directory

2017-05-08 Thread Duncan Murdoch
uld cause the problem here, if that's not just a typo in this message. Duncan Murdoch On Mon, May 8, 2017 at 4:36 PM, Duncan Murdoch mailto:murdoch.dun...@gmail.com>> wrote: On 08/05/2017 6:59 AM, Archit Soni wrote: Hey Ben, I tried this, # identify

Re: [R] Problem with choose.files(default=..., multi=FALSE)

2017-05-09 Thread Duncan Murdoch
irectory seems wrong when I have the pathlong default. Did you see that? (I'm in Windows 10, not the same version as you.) Duncan Murdoch When using choose.files() where: default = something multi = FALSE selected file path is shorter than the default ... then the returned

Re: [R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread Duncan Murdoch
la first in your dataframe. This would need to be fixed in the package. A workaround might be to name the columns with unique names that won't be found anywhere else, e.g. name your column "NeuTime" instead of "time". Duncan Murdoch

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Duncan Murdoch
d outside the plotting area, set "inset" and "xpd" arguments. For example, plot(1,1) legend("top", pch = 1, legend = "point", inset = -0.1, xpd = TRUE) Duncan Murdoch __ R-help@r-project.org mailing list --

Re: [R] installing caret package

2017-05-12 Thread Duncan Murdoch
similar to prevent this kind of error. (But I don't see "sigma" being used in the current source, so this may have been addressed already, or the error message may be tricking me into looking in the wrong place.) Duncan Murdoch ___

Re: [R] display double dot over character in plotmath?

2017-05-15 Thread Duncan Murdoch
in the default device or pdf(). The trouble with Unicode solutions is that R graphics devices aren't required to support it. Duncan Murdoch In your ggplot example, something like: ggplot(data, aes(x=X)) + geom_line(aes(y = Z), size=0.43) + xlab (expression(atop(top, bold(Age

Re: [R] plot problems

2017-05-15 Thread Duncan Murdoch
or RStudio, and should be asked in one of their help forums. This mailing list is for R itself. 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 pos

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-19 Thread Duncan Murdoch
ge on NA, and it is quite explicit about this: "Logical computations treat NA as a missing TRUE/FALSE value, and so may return TRUE or FALSE if the expression does not depend on the NA operand." I'm surprised nobody on this thread has quoted that before. Duncan Murdoch ___

Re: [R] Problem with choose.files(default=..., multi=FALSE)

2017-05-19 Thread Duncan Murdoch
there was no default or a short one, the two formats happened to look identical so we didn't notice this, but they differed when the default was longer than the result. Duncan Murdoch Keith Jewell On 09/05/2017 17:49, Duncan Murdoch wrote: On 09/05/2017 12:06 PM, Keith Jewell wrote:

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Duncan Murdoch
lied before performing the Op. Seems pretty consistent ... and also according to the principle of "least surprise" (for me at least). The surprise is that as.logical("TRUE") returns TRUE, whereas automatic coercion doesn't apply to ch

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Duncan Murdoch
On 20/05/2017 6:39 AM, Rolf Turner wrote: On 20/05/17 22:18, Duncan Murdoch wrote: On 20/05/2017 5:53 AM, Martin Maechler wrote: Ramnik Bansal on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an oper

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-21 Thread Duncan Murdoch
operations: you don't get auto-conversion of strings to logical/numeric values. This forces some inconsistencies between the primitive operations and explicit coercions like as.logical(), but we think that's a good thing. Duncan Murdoch On Sat, May 20, 2017 at 4:15 PM, Rolf Turner wro

Re: [R] Error: could not find function of a packge

2017-05-24 Thread Duncan Murdoch
getting attached fine. Any idea what is going wrong with the submission? Your help is much appreciated. Your NAMESPACE file doesn't export anything. For future reference, this is an R-devel or R-package-devel question rather than an R-help question. Please post follo

Re: [R] organizing data in a matrix avoiding loop

2017-05-26 Thread Duncan Murdoch
unique(dataMatrix[,2]), unique(dataMatrix[,3])) dataArray[dataMatrix[,1:3]] <- dataTrade$FLOW # Sum across years apply(dataArray, 3, sum) I haven't tried this (you didn't give a reproducible example...), so you may need to tweak it a bit. Duncan Murdoch _

Re: [R] get the value of a biplane

2017-05-29 Thread Duncan Murdoch
wmiller wrote: Looks like it is not exported from the package namespace... a packaging error. It's not an error to rely on the generic to get to a method. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see ht

Re: [R] get the value of a biplane

2017-05-29 Thread Duncan Murdoch
dio, if you set x <- bs(1:10), then type predict(x, and hit TAB, you are offered "object", "newx" and "..." as choices. On the other editors I mentioned you appear to get a list of argument names for all possible methods regardless of the class of x. Dun

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Duncan Murdoch
On 03/06/2017 6:31 AM, Vivek Sutradhara wrote: Hi all, I am having some problems in updating some packages from source. I start with : install.packages("Boom",lib="C:/RownLib",type="source") I get the following error message : Do you have multiple copies o

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Duncan Murdoch
On 03/06/2017 7:00 AM, Vivek Sutradhara wrote: Hi, As far as I can see, no. On checking, I have confirmed that the only location of cygwin1.dll is : C:\Rtools\bin I would re-install Rtools, and make sure C:\Rtools\bin appears first in your PATH. Duncan Murdoch Thanks Vivek 2017-06-03

Re: [R] months not working with local language (weekdays does)

2017-06-05 Thread Duncan Murdoch
month) formats. So this question probably needs to be addressed to Microsoft. Duncan Murdoch On 05/06/2017 3:21 PM, Rui Barradas wrote: Hello, This doesn't answer the question, but in portuguese it works as expected. > x <- as.Date("2017-06-05") > months(x) [1] "junho&

Re: [R] Paths in knitr

2017-06-08 Thread Duncan Murdoch
atest version makes it into the report. If the plots require lots of code and you think it would be distracting in the source of your document, then it's time to make a private package, and put the code in there. In the document, just include calls to functions from that package.

Re: [R] 3D plot with coordinates

2017-06-21 Thread Duncan Murdoch
ong the path to show it). Duncan Murdoch Thanks a lot.RegardsAlex On Tuesday, June 20, 2017 9:49 PM, Uwe Ligges wrote: package rgl. Best, Uwe Ligges On 20.06.2017 21:29, Alaios via R-help wrote: HelloI have three x,y,z vectors (lets say each is set as rnorm(360)). So each on

Re: [R] 3D plot with coordinates

2017-06-22 Thread Duncan Murdoch
theta) in polar coordinates in the XY plane, use (x = r*cos(theta), y = r*sin(theta), z = 0). Duncan Murdoch Regards Alex On Wednesday, June 21, 2017 3:21 PM, Alaios via R-help wrote: Thanks Duncan for the replyI can not suppress anything these are radiation pattern measurements that are typi

Re: [R] Missing dependencies in pkg installs

2017-06-22 Thread Duncan Murdoch
ng stringi_1.1.5.tar.gz you expand it using tar zxvf stringi_1.1.5.tar.gz and use ls -l stringi/configure to see if the system thinks it is executable, and in R, file_test("-x", "stringi/configure") to see what R sees. Duncan Murdoch On 22/06/2017 3:38 AM, Martin Maech

Re: [R] Missing dependencies in pkg installs

2017-06-22 Thread Duncan Murdoch
z") You can single step until you see the message, and try to diagnose why it is happening. Watch out, this function will exit R at the end. Duncan Murdoch [meconk@dcex1102shinypr ~]$ ls -l stringi/configure -rwxr-xr-x 1 meconk meconk 173757 Apr 7 11:43 stringi/configure [meconk@dcex1

Re: [R] Missing dependencies in pkg installs

2017-06-22 Thread Duncan Murdoch
i' * removing '/usr/lib64/R/library/stringi' Error in do_exit(status = status) : .install_packages() exit status 1 Error in do_exit(status = status) : .install_packages() exit status 1 -- W. Michael Conklin EVP Marketing & Data Sciences GfK T +1 763 417 4545 | M +1 612 567 8287

Re: [R] Missing dependencies in pkg installs

2017-06-22 Thread Duncan Murdoch
is done. (This is common on Windows, but I've never heard of it before on Linux.) Hopefully someone else can help... Duncan Murdoch Browse[2]> dir(new) [1] "DESCRIPTION" "INSTALL" "LICENSE" "MD5" [5] "NAMESPACE"

Re: [R] Extraneous full stop in csv read

2017-06-29 Thread Duncan Murdoch
syntactic use. You can stop this correction by setting check.names=FALSE in your call to read.csv. This will make it a little tricky to deal with in some situations, e.g. > x <- data.frame(4) > names(x) <- "in" > x in 1 4 > x$in Error: unexpected 'in' i

Re: [R] R console not echoing input

2017-07-03 Thread Duncan Murdoch
ink.number() > 0) sink() than in providing useful information. Duncan Murdoch On 03/07/2017 4:13 PM, Professor Bickis wrote: I have a weird problem running R.app 3.3.2 under Mac OS X 10.10.5. I was trying to interrupt a command line using various Control codes until I discovered that “Esc”

Re: [R] R and UBUNTU startup

2017-07-04 Thread Duncan Murdoch
hould get you access to the HTML versions. The pdf versions aren't always built; it depends on how you do the build. Duncan Murdoch And question 3 is simple. Are there some kind of "Linux R for Windows dummies" available? Best regards Petr

Re: [R] helix spring in R

2017-07-10 Thread Duncan Murdoch
On 10/07/2017 8:41 AM, Eliza B wrote: Dear useRs, Is there a way to draw helix spring in R of desired diameter and number of turns? Yes, use rgl's cylinder3d function. (Or lines3d if you don't want any volume.) Duncan Murdoch _

Re: [R] setwd in windows

2017-07-14 Thread Duncan Murdoch
\Users\\murdoch\\Documents/secdir" > Sys.setenv(R_USER = "C:/firstdir") > path.expand("~/secdir") [1] "C:\\Users\\murdoch\\Documents/secdir" R sets the home directory during startup, it doesn't consult the R_USER variable every time it needs it. Duncan Murdoch

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-15 Thread Duncan Murdoch
-contained example, not using the lodown and archive packages. I imagine you can do this by uploading the file you downloaded, or enough of a subset of it to trigger the segfault. If you can't do that, then likely the bug is with one of those packages, not with R. Duncan Mu

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-15 Thread Duncan Murdoch
to trigger the segfault. thanks! Hopefully someone can debug it with the info you provided. Duncan Murdoch On Sat, Jul 15, 2017 at 10:32 AM, Anthony Damico mailto:ajdam...@gmail.com>> wrote: hi, thanks Dr. Murdoch i'd appreciate if anyone on r-help could help me narro

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-15 Thread Duncan Murdoch
while (count < size) { nonzeros <- min(c(size - count, 100, zeros - 1)) if (nonzeros) { writeBin(rep(32L, nonzeros), con, size = 1) count <- count + nonzeros } zeros <- zeros - nonzeros if (length(zeros) && min(zeros) == 1) { writeBin(0L, con, size = 1)

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Duncan Murdoch
age can be avoided at least. i'm sorry for the bother How big is that text file? I wouldn't expect my script to take more than a few minutes even on a huge file. My script might have a bug... Duncan Murdoch On Sat, Jul 15, 2017 at 4:14 PM, Duncan Murdoch mailto:murdoch.dun.

Re: [R] Creating/Reading a complex string in R

2017-07-19 Thread Duncan Murdoch
escape the odd characters and be done with it. But using backticks is a bad idea because they ate not just another kind of quote. I agree. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] Ifelse statements and combining columns

2017-07-24 Thread Duncan Murdoch
etween arguments, and the parentheses don't appear to be in the right place. One suggestion for Kirsten: instead of dat$cond == "cond1" | dat$cond == "cond2" | dat$cond == "cond3" | dat$cond == "cond4" it is shorter and a bit clearer to write dat$co

Re: [R] switch of cex adjustment with mfrow?

2017-08-02 Thread Duncan Murdoch
par(mfrow = c(nr, nc), cex = cex) } Then use setmfrow(2,2) and set both things at once. 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 h

Re: [R] Layer problem in DrawDensity3D (VecStatGraphs3D)

2017-08-04 Thread Duncan Murdoch
3D is producing the grid of values, but you'd likely have to modify it to use a bigger grid around the points, (so the density falls close to zero at the boundaries), or to artificially surround the density estimates with a layer of zero density values. Dunc

Re: [R] Error in setwd("dir") :

2017-08-05 Thread Duncan Murdoch
e a directory coded. But more likely you've just missed fixing something. 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] about saving format

2017-08-05 Thread Duncan Murdoch
RStudioGD to pdf. So this really is an RStudio bug. Duncan Murdoch Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, A

Re: [R] Crash when installing heavy packages in remote server with R and Rstudio server

2017-08-06 Thread Duncan Murdoch
tudio Server specific. You'll need to write to their tech support for help. This list is for R issues. Duncan Murdoch I try doing it with this code and get the error below. install.packages("devtools") devtools::install_github("pbiecek/PISA2000lite") D

Re: [R] Crash when installing heavy packages in remote server with R and Rstudio server

2017-08-06 Thread Duncan Murdoch
On 06/08/2017 2:57 PM, Duncan Murdoch wrote: On 06/08/2017 9:17 AM, Jorge Cimentada wrote: Hi, I've been trying to install some very heavy packages from Github (~ 100MB - 300 MB) on my remote server using Rstudio server and I keep getting some crashes. These packages are pretty much dat

Re: [R] Problem with serialization via readRDS() on a textConnection()

2017-08-09 Thread Duncan Murdoch
t the result from the variable tempConnection. However, this doesn't fix the problem you saw, which appears to be a bug in readRDS or gzcon. I'll post it to the bug list. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Problem with serialization via readRDS() on a textConnection()

2017-08-09 Thread Duncan Murdoch
On 09/08/2017 9:01 AM, Duncan Murdoch wrote: (Sorry for not linking to your message; I accidentally deleted the original copy of your message.) Your code > zz = textConnection('tempConnection', 'wb') > saveRDS(c("a", "b", "c"), zz, asc

Re: [R] Help creating the IBM Randu function

2017-08-14 Thread Duncan Murdoch
a function body has only a single statement. Duncan Murdoch On Mon, Aug 14, 2017 at 12:49 PM, Martin Møller Skarbiniks Pedersen wrote: Dear all, I am trying to learn functions in R and 3D plotting so I decided to try to plot the famous bad PRNG Randu from IBM(1). However something is

Re: [R] How to convert .Rdata file into .csv or something else?

2017-08-17 Thread Duncan Murdoch
he object "d" remained empty. d <- load("~/docdis/input/ch2/WV6_Data_R_v_2016_01_01.rdata") The variable d should have contained the names of objects from that file. If it was empty, then something went wrong. Duncan Murdoch I would like to know how to convert this fi

Re: [R] Getting all possible combinations

2017-08-23 Thread Duncan Murdoch
On 23/08/2017 6:25 PM, Bert Gunter wrote: Doesn't sort by size of subgroup. I interpret the phrase I asterisked as: You were fooled by Peter's tricky single negative. Duncan Murdoch Your code does the following: First subsets of size 1 are given. Then all subsets of size 2

Re: [R] getOption() versus Sys.getenv

2017-08-25 Thread Duncan Murdoch
n) to run another process, and you want to communicate with it. The options live entirely within a given session. The .Renviron and .Rprofile files hide this difference, but they aren't the only ways to set these things, they're just convenient ways to set them at the start of a se

Re: [R] How to use getSymbols() to get annual data

2017-09-02 Thread Duncan Murdoch
quot;2000-01-01",to="2016-12-31") Presumably you'd need to loop over the years: get all the daily data in a year, calculate the overall High and Low, take the Open from the first date, the Close from the last one, and repeat. Duncan Murdoch

Re: [R] [FORGED] Re: Block comment?

2017-09-02 Thread Duncan Murdoch
impossible. If the first line is a comment, all the rest are too. 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/posti

Re: [R] [FORGED] Re: Block comment?

2017-09-03 Thread Duncan Murdoch
On 03/09/2017 12:49 AM, Rolf Turner wrote: On 03/09/17 12:29, Duncan Murdoch wrote: On 02/09/2017 6:57 PM, Rolf Turner wrote: On 03/09/17 03:56, William Dunlap via R-help wrote: Is the reason you want a block comment containing code (as opposed to arbitrary text) that you want to be able to

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
well, and could see that the post_processor was being run. I didn't get useful output, because the LaTeXing failed (I don't have the rsos.cls), but perhaps you've already fixed this problem, or perhaps it is intermittent? Duncan Murdoch Best regards, Thierry post_p

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 07/09/2017 10:11 AM, Thierry Onkelinx wrote: remove.packages("INBOmd") devtools::install_github("inbo/INBOmd@post_processor") setwd(system.file("rmarkdown/templates/rsos_article/skeleton", package = "INBOmd")) debug(INBOmd::rsos_article) rmarkdown::render("skeleton.Rmd") __

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
sulting in the compilation error "Undefined control sequence. l.128 \EndFirstPage" That certainly indicates it isn't doing what you want, but it might be running and doing something else. Duncan Murdoch I still get the error with the current version of the code. Running

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 07/09/2017 2:04 PM, Duncan Murdoch wrote: On 07/09/2017 10:11 AM, Thierry Onkelinx wrote: Dear Duncan, Thanks for chiming in. Could you explain how you set debug() on post_processor()? I've tried adding debug(post_processor) to rsos_article() or adding debug(post_processor) when

Re: [R] post_processor in rmarkdown not working

2017-09-08 Thread Duncan Murdoch
Pandoc, then LaTeX (via Latexmk), then the post-processor, then LaTeX again. This suggests a solution to the rsos_article problem: somehow make sure that the LaTeX is valid from the start, e.g. by defining dummy versions of the missing macros. Duncan Murdoch I actually started by copying the

Re: [R] quote()/eval() question

2017-09-08 Thread Duncan Murdoch
ntactic sugar. What your second line does is the same as eval(df, mySummary) which makes no sense. These would work: eval(df, expr = mySummary) eval(mySummary, envir = df) You could write the first as df %>% eval(expr = mySummary) and the second as df %>% eval(mySummary, envir =

Re: [R] (no subject)

2017-09-13 Thread Duncan Murdoch
from gsl-config is -I/usr/local/Cellar/gsl/1.16/include and I can see using less /usr/local/Cellar/gsl/1.16/include/gsl/gsl_version.h that the macros are defined as #define GSL_VERSION "1.16" #define GSL_MAJOR_VERSION 1 #define GSL_MINOR_VERSION 16 Presumably you'll get something

Re: [R] (no subject)

2017-09-13 Thread Duncan Murdoch
GSL_VERSION "2.3" #define GSL_MAJOR_VERSION 2 #define GSL_MINOR_VERSION 3 It's puzzling. Sure is. I can't see what would be going wrong. Duncan Murdoch David On 09/13/2017 02:57 PM, Duncan Murdoch wrote: On 13/09/2017 5:23 AM, Brayford, David wrote: When I try to install gsl

Re: [R] How to add make option to package compilation?

2017-09-15 Thread Duncan Murdoch
when I use the install.packages() function? That will probably speed up the package installation process 390%. See the Ncpus argument in ?install.packages. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] remove quotes from matrix

2017-09-19 Thread Duncan Murdoch
after converting x to a matrix. 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 c

Re: [R] Add wrapper to Shiny in R package

2017-09-21 Thread Duncan Murdoch
defined outside of that. So you should move my.env to the global environment where the server can see it, or define the app within myApp, where its functions can see locals for that function. Duncan Murdoch app = shinyApp( ui = fluidPage( sidebarLayout( sidebarPanel(sliderI

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Duncan Murdoch
.1),rnorm(1,0.5,0.1),rnorm(1,0.8,0.1)),2,2,byrow=T)) Peter's mapply solution is probably the best. Another that might be a little faster (but more obscure) is to use a 3-index array. I think this is what you'd want, with sa, so, and m as defined above: ms <- array(c(rep(0, 5

Re: [R] R 3.4.2 is released

2017-09-28 Thread Duncan Murdoch
from maintenance of the Rtools collection. Duncan Murdoch ___ r-annou...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-announce __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Duncan Murdoch
how to get that to work...yet. On 9/28/2017 5:11 AM, Duncan Murdoch wrote: ms <- array(c(rep(0, 5),sa*m,so,sa), c(5, 2, 2)) Sorry about that -- I didn't notice the "byrow = T" in your original. Duncan Murdoch __ R-help@r-pr

Re: [R] rgl crash on windows 7

2017-09-28 Thread Duncan Murdoch
river (or disabling hardware acceleration if that's something that it can do) could make a difference. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

[R] Regular expression help

2017-10-09 Thread Duncan Murdoch
regexprs, but am unable to find a way to say "transform words by deleting everything up to and including the 2nd slash" when there might be zero, one or two slashes.  Any suggestions? Duncan Murdoch __ R-help@r-project.org mailing list -- To UN

Re: [R] Regular expression help

2017-10-09 Thread Duncan Murdoch
plit(lines, " ") l3 <- lapply(l2, function(x) { y <- strsplit(x, "/") sapply(y, function(z) if (length(z) == 3) z[3] else "") }) Duncan Best, Ulrik On Mon, 9 Oct 2017 at 17:03 Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> wro

Re: [R] Regular expression help

2017-10-09 Thread Duncan Murdoch
87" > gsub("(^| *)([^/ ]*/?){0,2}", "\\1", x) [1] " 587 587 587 587" > y <- "aa aa/ aa/bb aa/bb/ aa/bb/cc aa/bb/cc/ aa/bb/cc/dd aa/bb/cc/dd/" > gsub("(^| *)([^/ ]*/?){0,2}", "\\1", y) [1] &q

Re: [R] stopifnot() doesnt work as I expect it to. Are my expectations correct?

2016-05-20 Thread Duncan Murdoch
#x27;d be interested in seeing those errors, so I don't think I'd change it. 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] stopifnot() doesnt work as I expect it to. Are my expectations correct?

2016-05-20 Thread Duncan Murdoch
Yes, that's an example where the proposed behaviour makes sense. But stopifnot(is.data.frame(df)); stopifnot(is.integer(df$ID)) isn't that much harder to type, and it already does what you want. Duncan Murdoch f(data.frame(ID=4:7)) # [1] 4 7 f(4:7) # Error in df$ID : $ operato

Re: [R] rjags crashes RStudio every time it tries to load

2016-05-20 Thread Duncan Murdoch
efore? The package does seem to load successfully in regular R, but I would prefer not to be constrained to that platform if possible. Since this is RStudio-specific, you'll need to ask on one of the RStudio forums. Duncan Murdoch __ R-help@r-p

Re: [R] meaning of lm( y~., data=mydat ), is it a language feature, is it documented, is it supported?

2016-05-23 Thread Duncan Murdoch
ure of the R language? Where can I find it documented? I would hate to write code that is dependent on a non-supported, non-documented language feature. It is documented in the Introduction to R manual (hidden in section 11.5, "Updating fitted models"), and in ?formula, which ?lm ref

Re: [R] print all variables inside function

2016-05-23 Thread Duncan Murdoch
27;fprint' which takes exmp1 as the input: fprint(exmp1). Why create them first? Just do something like this: knowns <- c( pa=0.35 pb=0.35 pc=0.30 pad=0.015 pbd=0.010 pcd=0.020) Duncan Murdoch __ R-help@r-project.org mailing list --

Re: [R] strange error

2016-05-25 Thread Duncan Murdoch
d the problem by using Windows 10? Or is there anything else I can do? This is an RStudio problem, not an R problem. One solution is to make the "Plots" pane bigger. There may be others -- you'll have to contact RStudio for help with it. Duncan Murdoch __

Re: [R] Shaded areas in R

2016-05-26 Thread Duncan Murdoch
x,y) in this case, or any other function that allows me to draw a shaded area under the curve on a time series basis? Times and dates just print like characters, they aren't actually characters. For example, x <- Sys.Date() + 1:20 y <- rnorm(20) plot(y ~ x) polygon(c(

Re: [R] Shaded areas in R

2016-05-26 Thread Duncan Murdoch
ion; you should also send your questions to R-help, not privately. I've cc'd my response there. 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] colored table

2016-05-28 Thread Duncan Murdoch
what? Duncan Murdoch Function values that I would like to print in the table x.eq.minus1 x.eq.zero x.eq.plus1 y.eq.minus1 -20 10-5 y.eq.zero -10 6 22 y.eq.plus1-8

Re: [R] Application of "merge" and "within"

2016-05-28 Thread Duncan Murdoch
16 13 3 3 1 1 G1 D1 3 19 13 6 4 1 1 G1 D1 4 12 13 -1 5 1 1 G1 D1 5 19 13 6 Just use s <- within(s, db <- b - bl) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] Query about Text Preprocessing (Encoding)

2016-05-29 Thread Duncan Murdoch
d R's support for those is mixed. - You need to make sure your graphics device supports your alphabet. Not all graphics devices have character support for all languages. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] Request for help

2016-06-03 Thread Duncan Murdoch
ile following the instructions contained in it, doing lots of previewing to make sure it looks okay. Run checks reasonably frequently to find your errors and omissions. Duncan Murdoch Finally, google! -- there are many other tutorials on this on the web. Cheers, Bert Bert Gunter "The

Re: [R] detecting if a variable has changed

2016-06-05 Thread Duncan Murdoch
On 05/06/2016 2:13 PM, Bert Gunter wrote: Nope, Ted. I asked for a O(log(n)) solution, not an O(n) one. I don't think that's possible with a numeric vector. Inserting an entry at a random location is an O(n) operation, since you need to move all following values out of the way

Re: [R] Faster Multivariate Normal

2016-06-07 Thread Duncan Murdoch
atrix and just make one call to dmvnorm. Duncan Murdoch Thank you Harold library(mvtnorm) ### Create parameters for MVN mu <- c(0,0,0,0) cov <- matrix(.2, ncol= 4,nrow=4) diag(cov) <- 1 sigma <- as.matrix(cov) ### Create nodes and expand to 4 dimensions for quadrature dm <- l

Re: [R] create an empty data frame and then fill in it

2016-06-09 Thread Duncan Murdoch
add them, e.g. df_year$hs_MteBove <- ... 2. Create your columns with the right length from the beginning: df_year <- data.frame(day = rep(as.Date(NA), 182), ...) I don't like this solution as much. Duncan Murdoch __ R-help@r-project.org

Re: [R] create an empty data frame and then fill in it

2016-06-09 Thread Duncan Murdoch
add them, e.g. df_year$hs_MteBove <- ... 2. Create your columns with the right length from the beginning: df_year <- data.frame(day = rep(as.Date(NA), 182), ...) I don't like this solution as much. Duncan Murdoch __ R-help@r-project.org

Re: [R] Importing data from a text file with no separator

2016-06-09 Thread Duncan Murdoch
On 09/06/2016 8:56 AM, Federman, Douglas wrote: ?read.fwf There is a data import/export document on cran.r-project.org And included with R distributions. It's one of the manuals, and will be accessible via the help menu in front ends that have one. Duncan Murdoch -Ori

Re: [R] R install on AIX 7

2016-06-09 Thread Duncan Murdoch
6.2. It also mentions an "R on AIX" project; I don't know if that is still active. Duncan Murdoch My ultimate goal is to integrate R with microstrategy and my microstrategy server is on AIX 7, so i need to have R installed over there before i can install integration pack. An

Re: [R] create an empty data frame and then fill in it (and then evaluate the mean of semi-hourly data for each day)

2016-06-10 Thread Duncan Murdoch
ow_day$day, function(x) round(mean(df_snow$snow[df_snow$day == x], na.rm=T)), 0) The 0 at the end is an example of the numeric function result you want, so that vapply() knows to create a numeric vector. Duncan Murdoch day snow NA NULL NA.1 NULL N

Re: [R] save rgl.sphere plot

2016-06-10 Thread Duncan Murdoch
mend using knitr and rglwidget. For example, put this in example.Rmd: --- title: "Example" author: "Duncan Murdoch" date: "June 10, 2016" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} options(rgl.useNULL = T

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