Re: [R] [FORGED] Re: tcltk problems

2017-11-20 Thread Berwin A Turlach
G'day Peter, On Sat, 18 Nov 2017 23:20:25 +0100 peter dalgaard wrote: > Hum, missed that bit. Looking at the configure script, the only way I > can see it failing to look in /usr/lib/tcl8.6 is if ${LIBnn} is not > "lib". Any chance it might be set to lib64? Well, yes, in an earlier e-mail Rolf

Re: [R] Generating help files for a function

2017-12-16 Thread Berwin A Turlach
G'day Erin, On Sat, 16 Dec 2017 08:00:38 -0600 Erin Hodgess wrote: > I'm in the process of writing a package, and I'm using the lovely "R > Package" book as a guideline. > > However, in the midst of my work, I discovered that I had omitted a > function and am now putting in it the package. No

Re: [R] Nonlinear regression

2017-12-19 Thread Berwin A Turlach
G'day Timothy, On Tue, 19 Dec 2017 18:28:00 -0600 Timothy Axberg wrote: > Should I repost the question with reply-all? Nope, we got all from Jeff's post. :) > On Tue, Dec 19, 2017 at 6:13 PM, Jeff Newmiller > wrote: > > > You also need to reply-all so the mailing list stays in the loop. > >

Re: [R] Fwd: Quadratic programming, for loop

2018-06-26 Thread Berwin A Turlach
G'day all, On Tue, 26 Jun 2018 11:16:55 +0300 Maija Sirkjärvi wrote: > It seems that my Amat and dvec are incompatible. Amat is a matrix of > zeros size: *2*J-3,J* and dvec is a vector of length *J*. There > should be no problem, but apparently there is. [...] solve.QP solves the quadratic prog

Re: [R] Fwd: Quadratic programming, for loop

2018-06-29 Thread Berwin A Turlach
G'day Maija, On Wed, 27 Jun 2018 08:48:08 +0300 Maija Sirkjärvi wrote: > Thanks for your reply! Unfortunately something is still wrong. > > After the transpose, dvec and Amat are still incompatible. > > > d <- -hsmooth > > dvec <- t(d) > > c <- dvec*Amat > Error in dvec * Amat : non-conforma

Re: [R] deviance in GLM vs. summary.glm

2017-05-31 Thread Berwin A Turlach
use it to compare models fitted by glm()? (see help(anova.glm)) > So I get very different p value on the interaction term, can someone > share what's going wrong here? Data separation, aka Hauck-Donner phenomenon, discussed in any good book on logistic regression. Best wishes, B

Re: [R] cbind question, please

2015-04-24 Thread Berwin A Turlach
G'day Erin, On Thu, 23 Apr 2015 20:51:18 -0400 Erin Hodgess wrote: > Here is the big picture. I have a character vector with all of the > names of the variables in it. > > I want to "cbind" all of the variables to create a matrix. > > Doing 3 is straightforward, but many, not so much. So I g

Re: [R] Feature or bug?

2015-05-21 Thread Berwin A Turlach
tion(input){ + print(paste("Before", input$time)) + update(input, 1) + print(paste("After:", input$time)) + } R> ginput <- new.env() R> ginput$time <- 0 R> server(ginput) [1] "Before 0" [1] "After: 1" HTH. Cheers, Berwin =

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-23 Thread Berwin A Turlach
G'day Rolf, On Thu, 23 Aug 2018 22:57:35 +1200 Rolf Turner wrote: > I *think* that this is an R question (and *not* an RStudio question!) Others may disagree... :) > I have, somewhat against my better judgement, decided to experiment > with using RStudio. Very good if you are still involved w

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-23 Thread Berwin A Turlach
G'day Rolf, On Thu, 23 Aug 2018 23:34:38 +1200 Rolf Turner wrote: > I guess I should have said --- I did > > sudo make prefix=/usr install > > which puts stuff into /usr rather than into /usr/local. ??? I do not remember ever specifying "prefix=foo" at the make install stage. Not for a

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-24 Thread Berwin A Turlach
G'day Peter, On Thu, 23 Aug 2018 08:45:37 -0700 Peter Langfelder wrote: > The manual, specifically > > https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installation > > documents this way of choosing the installation directory. Yes, with the caveat that one needs GNU or Solaris m

Re: [R] installing R 3.5.1

2018-08-25 Thread Berwin A Turlach
G'day Bogdan, On Fri, 24 Aug 2018 18:28:59 -0700 Bogdan Tanasa wrote: > I am trying to install R 3.5.1 on my Ubuntu 14.04 system; however, I > am getting the following message : > > sudo apt-get install r-base > [...] > The following packages have unmet dependencies: > r-base : Depends: r-reco

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-25 Thread Berwin A Turlach
G'day Rolf, On Sat, 25 Aug 2018 11:20:09 +1200 Rolf Turner wrote: > I was pretty sure that the foregoing was a complete red herring. And > I was right. I am not sure whether I agree. :) > I have been told by younger and wiser heads that installing from > source is The Right Thing to Do. Yo

Re: [R] installing R 3.5.1

2018-08-25 Thread Berwin A Turlach
Dear Bogdan, On Sat, 25 Aug 2018 07:24:40 -0700 Bogdan Tanasa wrote: > installed E: Unable to correct problems, you have held broken > packages. Perhaps this is the problem, did you try "apt-get -f install"? Cheers, Berwin __ R-help@r-proje

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-25 Thread Berwin A Turlach
G'day Rolf, On Sun, 26 Aug 2018 13:00:34 +1200 Rolf Turner wrote: > On 08/26/2018 02:59 AM, Berwin A Turlach wrote: > > > I am not sure whether I agree. :) > > Huh? Black is white and up is down??? Nope, but as I said, on my machine RStudio and the R installed from

Re: [R] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-20 Thread Berwin A Turlach
G'day Paul, On Thu, 19 Jan 2017 10:52:16 -0600 Paul Johnson wrote: > In Centos 7 systems, I wrote a script that runs on the cron and I > notice some package updates and installs fail like this: > > [] > > I understand I need something like xvfb to simulate an X11 session, > but I don't und

Re: [R] NAMESPACE vs internal.Rd

2008-07-16 Thread Berwin A Turlach
ub. HTH (and HTIC). Cheers, Berwin === Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applied Probability+65 6516 6650 (self) Faculty of Science FAX : +65 6872 3919

Re: [R] NAMESPACE vs internal.Rd

2008-07-16 Thread Berwin A Turlach
o not need to be documented (for "R CMD check" to succeed), but it is no error to document them. Objects that are visible to the users of the package have to be documented. HTH (and HTIC). Cheers, Berwin === Full address = Be

Re: [R] calculate differences - strange outcome

2008-07-17 Thread Berwin A Turlach
FAQ 7.31 and the reference cited therein should shed light on your problem. Best wishes, Berwin =========== Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applie

Re: [R] NAMESPACE vs internal.Rd

2008-07-17 Thread Berwin A Turlach
G'day Christophe, On Wed, 16 Jul 2008 18:22:49 +0200 [EMAIL PROTECTED] wrote: > Thanks for your answer. My pleasure. > > I guess writing > > a regular expression that says "export everything that does not > > start with a dot but do not export foo and bar" would be not > > trivial to write (at

Re: [R] Simple... but...

2008-07-23 Thread Berwin A Turlach
G'day Shubha, On Wed, 23 Jul 2008 18:24:49 +0530 "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way R> as.vector(rbind

Re: [R] truncated normal

2008-07-23 Thread Berwin A Turlach
TH. Cheers, Berwin =========== Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applied Probability+65 6516 6650 (self) Faculty of Science FAX : +65 6872 3919 Nat

Re: [R] Extracting formula from an lm object

2008-08-24 Thread Berwin A Turlach
[2]]) [1] "name" R> typeof(tt[[2]]) [1] "symbol" R> tt[[2]] <- as.name("y") R> tt y ~ dist + climb R> tt <- formula(fm) R> tt[[2]] <- as.symbol("z") R> tt z ~ dist + climb HTH. Cheers, Berwin ==

Re: [R] acf gives correlations > 1

2009-09-14 Thread Berwin A Turlach
(ind) / sig2 [1] 1.280317 HTH Cheers, Berwin == Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)+61 (8) 6488 3383 (self) The University of Western Australia

Re: [R] capturing errors in Sweave

2010-03-02 Thread Berwin A Turlach
+ Sweave code end ++ Now what I would like to know is how to include easily warning messages in my Sweave output without having to try whether Jean Lobry's [1] hack still works. :) HTH. Cheers, Berwin [1] https://www.stat.math.ethz.

Re: [R] capturing errors in Sweave

2010-03-02 Thread Berwin A Turlach
G'day Sundar, On Tue, 2 Mar 2010 01:03:54 -0800 Sundar Dorai-Raj wrote: > Thanks, Berwin. That works just great! You are welcome. I noticed by now that "cat(tmp)" is sufficient; the "tmp[1]" in "cat(tmp[1])" was a left over from earlier attempts to get the output to look correct. Cheers,

Re: [R] OT Sorta: Odds Are, It's Wrong...

2010-03-15 Thread Berwin A Turlach
G'day all, On Mon, 15 Mar 2010 12:46:42 -0500 Marc Schwartz wrote: > In turn, that reminds me of Stephen Senn's writing in Dicing with > Death: Chance, Risk and Health: > > "We can predict nothing with certainty but we can predict how > uncertain our predictions will be, on average that is." A

Re: [R] language!!!

2010-03-18 Thread Berwin A Turlach
lcome. Cheers, Berwin == Full address ======== Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)+61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 St

Re: [R] From THE R BOOK -> Warning: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!

2010-03-30 Thread Berwin A Turlach
i.e. Null); 39 Residual Null Deviance: 9.256 Residual Deviance: 5.229AIC: 49.87 Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm! HTH, Cheers, Berwin ====== Full address Berwin A Tur

Re: [R] pdf files in loops

2010-03-31 Thread Berwin A Turlach
Berwin == Full address ======== Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)+61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 Stirl

Re: [R] pdf files in loops

2010-03-31 Thread Berwin A Turlach
On Wed, 31 Mar 2010 22:06:48 -0400 James Rome wrote: > print() did not help, and I get strange messages about mode(onefile) > not being changed: Either: R> pic <- histogram(...) R> print(pic) or R> print(histogram(...)) > I would actually like all the histograms in one pdf file too... Then

Re: [R] Constrained Optimization

2009-11-04 Thread Berwin A Turlach
] 0.333 0.333 0.333 $iterations [1] 2 0 $iact [1] 1 You may want to consult: http://cran.r-project.org/web/views/Optimization.html HTH. Cheers, Berwin ====== Full address Berwin A Turlach Tel.: +61 (8) 64

Re: [R] Unexpected behaviour for as.date()

2009-11-10 Thread Berwin A Turlach
ent straight from 1BC to 1AD.. > Is there a way to force R to convert character dates from the year > 2000 into Julian dates? Presumably you will need something like: R> as.date(sub("-00", "-2000", "02-MAY-00")) [1] 2May2000 HTH. Cheers, Ber

Re: [R] Unexpected behaviour for as.date()

2009-11-10 Thread Berwin A Turlach
in that format: R> x <- c("02-MAY-00", "02-MAY-01") R> sapply(x, function(x) as.numeric(strsplit(x, "-")[[1]][3])) 02-MAY-00 02-MAY-01 0 1 HTH. Cheers, Berwin == Full address Ber

Re: [R] R and HDF5 Question

2009-11-13 Thread Berwin A Turlach
G'day Scott, On Fri, 13 Nov 2009 09:52:43 -0700 Scott MacDonald wrote: > I am trying to load an hdf5 file into R and running into some > problems. It's a while that I used hdf5 files and that package in R, but: > This builds fine. The library seems to load without issue, but no > data is retu

Re: [R] Relase positive with log and zero of negative with 0

2009-11-15 Thread Berwin A Turlach
<- log(x[ind]) R> x [1] 0.000 0.6931472 1.0986123 1.3862944 1.6094379 0.000 0.000 HTH. Cheers, Berwin == Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M0

Re: [R] Beyond double-precision?

2009-05-09 Thread Berwin A Turlach
x)) ## logarithm of harmonic mean [1] -1.600885 R> log(length(x)) - logadd(-lx) [1] -1.600885 Cheers, Berwin =========== Full address = Berwin A TurlachTel.: +65 6515 4416 (secr) Dept of Statistics and

Re: [R] Unintended loading of package:datasets

2009-05-10 Thread Berwin A Turlach
G'day David, On Sun, 10 May 2009 17:17:38 -0400 "David A Vavra" wrote: > The dataset package is being loaded apparently by one of the packages > that I am using. The loading of the datasets takes a long time and I > would like to eliminate it. I thought the datasets were effectively > examples s

Re: [R] Unintended loading of package:datasets

2009-05-10 Thread Berwin A Turlach
G'day David, On Sun, 10 May 2009 21:35:30 -0400 "David A Vavra" wrote: > Thanks. Perhaps something else is going on. There is a large time > period (about 20 sec.) after the message about loading the package. > More investigation, I suppose. What R version are you using? I do not remember ever

Re: [R] Getting lm() to work with a matrix

2009-05-20 Thread Berwin A Turlach
G'day Luc, On Wed, 20 May 2009 09:58:41 -0400 Luc Villandre wrote: > MikSmith wrote: > > [...] > Indeed, functions like /lm()/ require the object fed to the /data/ > argument to be either [...] But the data argument is optional and does not need to be specified. > In your situation, I sugges

Re: [R] Constrained fits: y~a+b*x-c*x^2, with a,b,c >=0

2009-05-27 Thread Berwin A Turlach
g to your subject line, you are trying to solve what is known as a quadratic program, and there are at least two quadratic programming solvers (ipop in kernlab and solve.qp in quadprog) available for R. HTH. Cheers, Berwin === Full address =

Re: [R] If statement generates two outputs

2009-03-23 Thread Berwin A Turlach
because it is not a valid name and, hence, the parser deduces that it is an operator? IIRC, the traditional way to define your own operator is to bound the name by percentage signs, i.e. replacing ":=" by "%colec%" and then issuing the command c(df1, df2) %colec% list(4:8, 9:

Re: [R] .Internal

2009-03-23 Thread Berwin A Turlach
st are referred to in that language, then you have no problems with understanding the names of those macros. Since I never became comfortable with those languages, I restrict myself to .C and .Call; YMMV. HTH. Cheers, Berwin =========== Full address =

Re: [R] Converting a Matrix to a Vector

2009-03-25 Thread Berwin A Turlach
7457 0.17655675 0.68702285 0.38410372 E.QA.RB.RC.RD.RE.RA.S 0.76984142 0.49769924 0.71761851 0.99190609 0.38003518 0.77744522 0.93470523 B.SC.SD.SE.S 0.21214252 0.65167377 0.1210 0.26722067 H

Re: [R] Conerned about Interfacing R with Fortran

2009-03-26 Thread Berwin A Turlach
s an underscore. HTH. Cheers, Berwin === Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applied Probability+65 6516 6650 (self) Faculty of Science FAX : +65 6872 3919

Re: [R] Bug? FORTTRAN help

2009-03-26 Thread Berwin A Turlach
cessing or writing into memory that you should not access or write to. HTH. Cheers, Berwin === Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applied Probabilit

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metricunits)

2009-04-03 Thread Berwin A Turlach
That's when I thought that the metric system is so much safer until I ordered my next beer, according to the menu a bottled beer of 400ml, it came in a 333ml bottle... Cheers, Berwin === Full address ============= Berwin A Turlach

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-04 Thread Berwin A Turlach
G'day Dirk, On Sat, 4 Apr 2009 20:27:22 -0500 Dirk Eddelbuettel wrote: > On 4 April 2009 at 14:37, Ken-JP wrote: > > Yes, I have x11-common installed, and dpkg -S /etc/X11/rgb.txt > > shows "not found" for me. This is on Ubuntu 8.10 amd64. > > Same 8.10 for both amd64 and i386 where I checked

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-05 Thread Berwin A Turlach
G'day Peter, On Sun, 05 Apr 2009 11:26:40 +0200 Peter Dalgaard wrote: > Berwin A Turlach wrote: > > G'day Dirk, > > > > On Sat, 4 Apr 2009 20:27:22 -0500 > > Dirk Eddelbuettel wrote: > > > >> On 4 April 2009 at 14:37, Ken-JP wrote: > >

Re: [R] Code of sample() in C

2009-04-05 Thread Berwin A Turlach
> return 2; > } > > for (i = 0; i < n; ++i) x[i] = i; > > for (i = 0; i < k; ++i) { > const int j = (int)(len * runif(0.0, 1.0)); > y[i] = x[j]; > x[j] = x[--n]; > } > free(x); > } >

Re: [R] Unable to re-import a table that was just exported to a file

2009-04-27 Thread Berwin A Turlach
ops up again and > again. I am already quite unhappy with this. ?read.table You might find that you are using col.names and row.names wrongly in the read.table command. Best wishes, Berwin === Full address = Berwin

Re: [R] The .tex version of the manual in foo.Rcheck

2009-04-28 Thread Berwin A Turlach
e the file is processed. But this can easily be changed by moving two lines in the script a bit higher, see the attached patch. Cheers, Berwin === Full address ===== Berwin A TurlachTel.: +65 6516 4416 (secr) Dept

Re: [R] The .tex version of the manual in foo.Rcheck

2009-04-29 Thread Berwin A Turlach
G'day Uwe, On Wed, 29 Apr 2009 11:03:43 +0200 Uwe Ligges wrote: > you can also take a source package an run > > R CMD Rd2dvi --no-clean packageName > > on it and you will get a temporary directory with the TeX sources in > it. Which is fine for manual processing and when done once or twice, b

Re: [R] Splitting a vector into equal groups

2009-05-04 Thread Berwin A Turlach
win === Full address = Berwin A TurlachTel.: +65 6516 4416 (secr) Dept of Statistics and Applied Probability+65 6516 6650 (self) Faculty of Science FAX : +65 6872 3919 National Univer

Re: [R] advice/opinion on "<-" vs "=" in teaching R

2010-01-15 Thread Berwin A Turlach
G'day all, On Fri, 15 Jan 2010 09:08:44 - (GMT) (Ted Harding) wrote: > On 15-Jan-10 08:14:04, Barry Rowlingson wrote: > >> [...] > > I would regard modifying a variable within the parameters of a > > function call as pretty tasteless. What does: > > > > foo(x<-2,x) > > or > > foo(x,x<-3)

Re: [R] Environmental oddity --- reproducible example.

2021-11-07 Thread Berwin A Turlach
G'day Rolf, On Sun, 7 Nov 2021 19:33:40 +1300 Rolf Turner wrote: > library(Deriv) > d1 <- Deriv(dnorm,"sd") > source("d2.txt") # d2.txt is attached > > d1(1,0,3,TRUE) # [1] -0.2962963 > d2(1,0,3,TRUE) # [1] -0.889 Fascinating: R> pryr::call_tree(body(d1)) R> pryr::call_tree(body(d2)) cle

Re: [R] Trying to learn how to write an "advanced" function

2023-03-16 Thread Berwin A Turlach
G'day John, For these snippets to produce what I think you want them to produce it is just necessary to define doit() as follows: doit <- function(x){ lm(formula=x) } R> # run formula y~x R> JD <- doit(y~x) R> JD Call: lm(formula = x) Coefficients: (Intercept)x 0.8403

Re: [R] question about update()

2023-05-04 Thread Berwin A Turlach
G'day Adelchi, hope all is well with you. On Thu, 4 May 2023 10:34:00 +0200 Adelchi Azzalini via R-help wrote: > Thanks, Duncan. What you indicate is surely the ideal route. > Unfortunately, in my case this is not feasible, because the > construction of xf and the update call are within an iter

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

2019-07-28 Thread Berwin A Turlach
G'day Anuj, On Sun, 28 Jul 2019 16:40:28 -0700 Anuj Goyal wrote: > Why does pdf() work outside a function, but not inside it? Because you use a graphics system that need printing to produce the plot. On the command line auto-printing is your friend, but in functions you have to do it explicitl

Re: [R] suprising behaviour of tryCatch()

2023-05-18 Thread Berwin A Turlach
G'day Federico, On Wed, 17 May 2023 10:42:17 + "Calboli Federico (LUKE)" wrote: > I_d be obliged if someone can explain why tryCatch assigns items with _<-_ > and not _=_. It is not just tryCatch but any function. In function calls the "=" is used to assign actual arguments to formal argu

Re: [R] suprising behaviour of tryCatch()

2023-05-18 Thread Berwin A Turlach
G'day Federico, On Wed, 17 May 2023 10:42:17 + "Calboli Federico (LUKE)" wrote: > sexsnp = rep(NA, 1750) > for(i in 1:1750){tryCatch(sexsnp[i] = fisher.test(table(data[,3], > data[,i + 38]))$p, error = function(e) print(NA))} Error: unexpected > '=' in "for(i in 1:1750){tryCatch(sexsnp[i] ="

Re: [R] suprising behaviour of tryCatch()

2023-05-18 Thread Berwin A Turlach
G'day Greg, On Thu, 18 May 2023 08:57:55 -0600 Greg Snow <538...@gmail.com> wrote: [...] > `fun(x <- expr)` Assigns the value of `expr` to the variable `x` in > the frame/environment that `fun` is called from. Only if the argument 'x' is evaluated during the function call AFAIK. If it is not, d

Re: [R] suprising behaviour of tryCatch()

2023-05-18 Thread Berwin A Turlach
G'day Henrik, On Thu, 18 May 2023 08:35:38 -0700 Henrik Bengtsson wrote: > ... or just put the R expression inside curly brackets, e.g. I was wondering whether I was having a fortunes::fortune(106) moment. :-) Cheers, Berwin __ R-help@r-pro

Re: [R] geom_smooth

2023-08-11 Thread Berwin A Turlach
G'day Thomas, On Sat, 12 Aug 2023 04:17:42 + (UTC) Thomas Subia via R-help wrote: > Here is my reproducible code for a graph using geom_smooth The call "library(tidyverse)" was missing. :) > I'd like to add a black boundary around the shaded area. I suspect > this can be done with geom_rib

Re: [R] Issues when trying to fit a nonlinear regression model

2023-08-20 Thread Berwin A Turlach
G'day Paul, On Sun, 20 Aug 2023 12:15:08 -0500 Paul Bernal wrote: > Any idea on how to proceed in this situation? What could I do? You are fitting a simple asymptotic model for which nls() can find good starting values if you use the self starting models (SSxyz()). Well, Doug (et al.) choose t

Re: [R] non-linear regression and root finding

2023-11-06 Thread Berwin A Turlach
G'day Troels, On Mon, 6 Nov 2023 20:43:10 +0100 Troels Ring wrote: > Thanks a lot! This was amazing. I'm not sure I see how the conditiion > pK1 < pK2 < pK3 is enforced? One way of enforcing such constraints (well, in finite computer arithemtic only "<=" can be enforced) is to rewrite the para

Re: [R] non-linear regression and root finding

2023-11-06 Thread Berwin A Turlach
G'day Troels, On Tue, 7 Nov 2023 07:14:02 +0100 Troels Ring wrote: > Be as it may, I wonder if not your method might work if only we KNOW > that pK1 is either positive OR negative, in which case we have pK1 = > -exp(theta1)? If pK1 can be either negative or positive (or 0 :-) ), and it is just

Re: [R] different results between cor and ccf

2024-01-16 Thread Berwin A Turlach
G'day Patrick, On Tue, 16 Jan 2024 09:19:40 +0100 Patrick Giraudoux wrote: [...] > So far so good, but when I lag one of the series, I cannot find the > same correlation as with ccf > > > cor(x[1:(length(x)-1)],y[2:length(y)]) [1] -0.7903428 > > ... where I expect -0.668 based on ccf > > Ca

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-13 Thread Berwin A Turlach
G'day Philipp, On Tue, 13 Feb 2024 09:59:17 +0100 gernophil--- via R-help wrote: > this question is related to this > (https://community.rstudio.com/t/packages-are-not-updating/166214/3), > [...] > To sum it up: If I am updating packages (be it via Bioconductor or > CRAN) some packages simply d

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-17 Thread Berwin A Turlach
G'day Philipp, On Fri, 16 Feb 2024 17:33:13 +0100 Philipp Schneider wrote: > Thanks for all the input. It's happening again. This time for the > packages "DBI", "parallelly", "segmented", "survival", "V8". So, > RStudio shows updates for those and updating them via RStudio leads > to this output

Re: [R] [External] converting MATLAB -> R | element-wise operation

2024-02-28 Thread Berwin A Turlach
On Tue, 27 Feb 2024 21:37:52 + "Richard M. Heiberger" wrote: > > t(t(NN)/lambda) > [,1] [,2] [,3] > [1,] 0.5 0.667 0.75 > [2,] 2.0 1.667 1.50 > > > > R matrices are column-based. MATLAB matrices are row-based. It might depend on what you mean with this statement, bu

Re: [R] converting MATLAB -> R | element-wise operation

2024-02-28 Thread Berwin A Turlach
On Tue, 27 Feb 2024 13:51:25 -0800 Jeff Newmiller via R-help wrote: > The fundamental data type in Matlab is a matrix... they don't have > vectors, they have Nx1 matrices and 1xM matrices. Also known as column vectors and row vectors. :) > Vectors don't have any concept of "row" vs. "column".

Re: [R] converting MATLAB -> R | element-wise operation

2024-02-28 Thread Berwin A Turlach
On Tue, 27 Feb 2024 14:54:26 -0500 Evan Cooch wrote: > So, trying to convert a very long, somewhat technical bit of lin alg > MATLAB code to R. Most of it working, but raninto a stumbling block > that is probaably simple enough for someone to explain. On https://cran.r-project.org/other-docs.

Re: [R] I am struggling with contrasts

2020-03-09 Thread Berwin A Turlach
G'day John, On Tue, 10 Mar 2020 01:42:46 + "Sorkin, John" wrote: > I am running a Poisson regression with a single outcome variable, > HGE, and a single independent variable, a factor, Group which can be > one of two values, Group1, or Group2. I am trying to define contrasts > that will give

Re: [R] I am struggling with contrasts

2020-03-10 Thread Berwin A Turlach
G'day all, On Tue, 10 Mar 2020 11:07:13 + "Viechtbauer, Wolfgang (SP)" wrote: > The linearHypothesis() function from the 'car' package does this. The function glht() in the 'multcomp' package should also be able to do this. The 'emmeans' package might also be useful. Will be off-line fo

Re: [R] Where did lost variables go

2013-12-31 Thread Berwin A Turlach
G'day David, On Mon, 30 Dec 2013 20:42:53 -0500 David Parkhurst wrote: Some wild guesses in the absence of a reproducible example. > I have several variables in a data frame that aren't listed by ls() > after I attach that data frame. ls() list the objects in the global environment. If you

Re: [R] forcing a zero level in contr.sum

2010-07-07 Thread Berwin A Turlach
;) [,1] [,2] 110 200 301 4 -1 -1 Levels: 1 2 3 4 R> contrasts(tmp) <- tt R> tmp [1] 1 1 1 2 2 2 3 3 3 4 4 4 attr(,"contrasts") [,1] [,2] [,3] 110 0.2886751 200 -0.8660254 301 0.2886751 4 -1

Re: [R] Namibia becoming NA

2010-07-18 Thread Berwin A Turlach
ould not be so: it should be preventable! It is, through simple use of the "na.strings" argument: R> X <- read.csv("temp.csv", na.strings="") R> X Code Country 1 DE Germany 2 IT Italy 3 NA Namibia 4 FR France R> which(is.na(X)) integer(0) HTH.

Re: [R] Call to rgamma using .C causes R to hang

2010-07-20 Thread Berwin A Turlach
tion 6.3 in the "Writing R Extensions manual. :) http://cran.r-project.org/doc/manuals/R-exts.html#Random-numbers HTH. Cheers, Berwin ========== Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School o

Re: [R] OT: What distribution is this?

2010-09-25 Thread Berwin A Turlach
rts if you try to determine the joint distribution of two (or more) entities. HTH. Cheers, Berwin ====== Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)

Re: [R] OT: What distribution is this?

2010-09-26 Thread Berwin A Turlach
G'day Rainer, On Sun, 26 Sep 2010 10:29:08 +0200 Rainer M Krug wrote: > I realized that I am simply interested in the pdf p(y) that y > *number* of entities (which ones is irrelevant) in N are are *not* > drawn after the sampling process has been completed. Even simpler (I > guess), in a first s

Re: [R] R Spracheinstellung

2010-09-29 Thread Berwin A Turlach
G'day Tobias, On Wed, 29 Sep 2010 14:01:10 + "Keller Tobias (kelleto0)" wrote: > Für unseren Statistik Unterricht brauchen wir das R-Programm. > Ich habe das Programm heruntergeladen, deutsch gewählt und > installiert. Das Problem ist nach 3mal neu installieren, dass das > Programm immer auf

Re: [R] how to make list() return a list of *named* elements

2010-10-04 Thread Berwin A Turlach
On Mon, 4 Oct 2010 19:45:23 +0800 Berwin A Turlach wrote: Mmh, > R> my.return <- function (vector.of.variable.names) { > sapply(vector.of.variable.names, function(x) list(get(x))) > } make that: R> my.return <- function (vector.of.variable.names) { sapply(vec

Re: [R] how to make list() return a list of *named* elements

2010-10-04 Thread Berwin A Turlach
(x))) } R> str(my.return(c("b","my.c"))) List of 2 $ b : num [1:5] 22.4 12.2 10.9 8.5 9.2 $ my.c: int [1:4] 7 5 23 4 Cheers, Berwin == Full address Berwin A Turlach Tel.: +61 (8) 6488 3338

Re: [R] exponentiate elements of a whole matrix

2010-10-13 Thread Berwin A Turlach
4 R> B <- exp(A) R> B [,1] [,2] [1,] 7.389056 20.08554 [2,] 7.389056 54.59815 Cheers, Berwin == Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)

Re: [R] declaring GPL license

2010-10-14 Thread Berwin A Turlach
G'day Marc, On Thu, 14 Oct 2010 10:46:39 -0500 Marc Schwartz wrote: > If you want (and you should), create and include a file called > "COPYING" in the 'inst' folder in the package, so that it gets copied > to the main package directory upon installation. [...] But that would be against the wis

Re: [R] declaring GPL license

2010-10-14 Thread Berwin A Turlach
G'day Stacey, On Thu, 14 Oct 2010 12:36:20 -0400 Stacey Wood wrote: > Thanks everyone. Now I know that I should not include another copy > of the license, but where should I refer to the copies on > http://www.r-project.org/Licenses/? In the DESCRIPTION file? I used to mention that location in

Re: [R] creating 'all' sum contrasts

2010-10-15 Thread Berwin A Turlach
here are any options for contrast() or other functions/libraries > that will allow me to do this automatically? Look at package multcomp, in particular functions glht and mcp, these might help. Cheers, Berwin == Full address Berwin

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Berwin A Turlach
/inlining across separate files is a tricky issue so few, if any, compilers would do so. 4) Check whether there is an option to specify which exportable symbols have to be in the DLL in the end. Cheers, Berwin == Full address =

Re: [R] R-Fortran question (multiple subroutines)

2010-10-25 Thread Berwin A Turlach
G'day all, On Mon, 25 Oct 2010 06:52:15 -0400 Duncan Murdoch wrote: > Remko Duursma wrote: [...] > > I.e, my code looks something like this: > > > > subroutine f(x,y,z) > > > > call g(x,y,z) > > > > end > > > > subroutine g(x,y,z) > > > > z = x*y > > > > end > > > > > > calling this from

Re: [R] cube root of a negative number

2010-10-26 Thread Berwin A Turlach
oned in FAQ 7.31 can probably shed more light on this issue. Cheers, Berwin == Full address ==== Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)+61 (8) 6488 3383 (self) Th

Re: [R] cube root of a negative number

2010-10-26 Thread Berwin A Turlach
G'day Bill, On Wed, 27 Oct 2010 10:34:27 +1100 wrote: [...] > It is no surprise that this does not work when working in the real > domain, except "by fluke" with something like > > > -4^(1/3) > [1] -1.587401 > > > > where the precedence of the operators is not what you might expect. > Now th

Re: [R] what´s wrong with this code?

2010-10-29 Thread Berwin A Turlach
G'day Jose, On Fri, 29 Oct 2010 11:25:05 +0200 José Manuel Gavilán Ruiz wrote: > Hello, I want to maximize a likelihood function expressed as an > integral that can not be symbolically evaluated. I expose my problem > in a reduced form. > > g<- function(x){ > integrand<-function(y) {ex

Re: [R] what´s wrong with this code?

2010-10-29 Thread Berwin A Turlach
G'day Jose, On Fri, 29 Oct 2010 11:25:05 +0200 José Manuel Gavilán Ruiz wrote: > Hello, I want to maximize a likelihood function expressed as an > integral that can not be symbolically evaluated. I expose my problem > in a reduced form. > > g<- function(x){ > integrand<-function(y) {ex

Re: [R] R version 2-12.0 - running as 32 or as 64 bit?

2010-10-29 Thread Berwin A Turlach
n always issue the command > .Machine$sizeof.pointer if the answer is 4, you are running 32bit, if the answer is 8, then you are running 64 bit. HTH. Cheers, Berwin == Full address ======== Berwin A Turlach

Re: [R] DBLEPR?

2010-11-16 Thread Berwin A Turlach
Berwin ========== Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)+61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 Stirling Highway

Re: [R] using ``<-'' in function argument

2010-12-02 Thread Berwin A Turlach
rse, once I got to their computer and looked at their screen, it was clear that they had typed: plot(fm = lm(y~x, data=some.data)) Cheers, Berwin == Full address Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and S

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Berwin A Turlach
G'day Ivan, On Fri, 03 Dec 2010 10:54:58 +0100 Ivan Calandra wrote: > Arf, yes it makes sense now! Well, my original post said: "R has lazy evaluation" and "the assignment takes place when the function evaluates the argument" :) > So the idea here is: never use "<-" in function argument... Ne

Re: [R] Retrieving Factors with Levels Ordered

2010-12-31 Thread Berwin A Turlach
","Black": 1 1 1 1 2 2 2 2 It might just be that the text representation used by dput() is not particularly digestible for the human eye. :) > (You're right, I don't have anything better to do on New Year's eve.) New Year's eve? The first day of the new year

Re: [R] expand.grid

2011-01-19 Thread Berwin A Turlach
re > included. R> expand.grid(lapply(dfrpart, function(x) c(levels(x), + if(any(is.na(x))) NA else NULL))) c1 c2 c3 1 ad g 2 bd g 3 d g 4 a e g 5 be g 6 e g 7 a g 8 b g 9 g 10ad h 11bd h HTH.

  1   2   3   >