Re: [R] help

2021-03-17 Thread hatice gürdil
Thank you so much
I thought that ncol is for dimension .
ncol= 2, 2x2 matris for 2 dimension
ncol= 3, 3x3 matris for 3 dimention

I have to work a little more considering what you said.

Cheers,

Hatice Gürdil.

Bill Dunlap , 16 Mar 2021 Sal, 21:09 tarihinde
şunu yazdı:

> The length of the mean vector must match the number of rows and
> columns of the sigma matrix.  Once you give 3 entries in the mean
> vector you will run into the problem that the sigma you are using is
> not positive (semi-)definite - a variance must be the product of a
> matrix and its transpose.
>
> -Bill
>
> On Tue, Mar 16, 2021 at 10:55 AM hatice gürdil
>  wrote:
> >
> > Code a is working. But code b is given error like given below. How can I
> > write code b?
> >
> > > a<-rmvnorm(750, mean=c(0, 0),
> > +sigma=matrix(c(1, .3, .3, 1), ncol=2))
> >
> > > head(a)
> > [,1][,2]
> > [1,] -0.97622921 -0.87129405
> > [2,]  0.54763494  0.16080131
> > [3,] -1.16627647  0.31225125
> > [4,]  1.72541168  2.06513939
> > [5,]  0.05372489 -0.07525197
> > [6,] -0.85062230 -1.02188473
> >
> > > b<-rmvnorm(round(500,0), mean=c(0,-1),
> > +sigma=matrix(c(.3, 1,1,1,.3, 1, 1,1, .3),
> ncol=3))
> >
> > Error in rmvnorm(round(500, 0), mean = c(0, -1), sigma = matrix(c(0.3,  :
> >   mean and sigma have non-conforming size
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > 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, reproducible code.
>

[[alternative HTML version deleted]]

__
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, reproducible code.


[R] [R-pkgs] domir: Tools to Support Relative Importance Analysis

2021-03-17 Thread Joseph Luchman
Hello All,

  I am pleased to announce that {domir} is now available on CRAN.

  {domir} aims to provide broadly applicable tools for the relative 
importance analysis of facets of statistical models and machine 
learning algorithms.  The focus for this initial release is on 
Dominance Analysis/Shapley Value Decomposition as a methodology - which 
is to be expanded in future versions.

  I hope the community finds the tool(s) in this package of value and I 
look forward to further developing the package in collaboration with 
the community.

  Note: {domir} version 0.0.0 has a known bug that affects 
functionality in R versions < 4.  Working on a patch to revise.

  Cordially,

- Joseph

CRAN: 
GibHub: 


[[alternative HTML version deleted]]

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
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, reproducible code.


[R] [R-pkgs] Splinets

2021-03-17 Thread Krzysztof Podgórski
Splinets -- a package with an efficient B-spline orthogonalization suitable for 
sparse functional data analysis.

See also: 

Liu, X., Nassar, H., Podgórski, K. (2019) "Splinets – efficient 
orthonormalization of the B-splines." .
Podgórski, K. (2021) "Splinets – splines through the Taylor expansion, their 
support sets and orthogonal bases." .
 

#
Krzysztof Podgorski
Professor
Department of Statistics 
Lund University
#
___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages
__
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, reproducible code.


[R] [R-pkgs] {miclust} Multiple imputation & cluster analysis

2021-03-17 Thread Jose Barrera
Dear all,

Want to perform cluster analysis but you have missing data?

Following researchers' suggestion, our R package miclust is now on CRAN:
https://CRAN.R-project.org/package=miclust

miclust implements a framework to integrate multiple imputed data sets due
to missing data in cluster analysis. Methods are described in the original
work: https://academic.oup.com/aje/article/177/7/718/91109

I hope you find it helpful.

On behalf of the authors,

Jose Barrera
Statistician, Associate Lecturer

*IS**Global*
Barcelona Institute for Global Health - Campus MAR
Barcelona Biomedical Research Park (PRBB) (Room Hypatia)

Doctor Aiguader, 88
08003 Barcelona, Spain
Tel. +34 93 2147383
jose.barr...@isglobal.org

Personal website: sites.google.com/view/josebarrera
www.isglobal.org

This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly
prohibited by law. If this message has been received in error, please
immediately notify us via e-mail and delete it.

DATA PROTECTION. We inform you that your personal data, including your
e-mail address and data included in your email correspondence, are included
in the ISGlobal Foundation filing system. Your personal data will be used
for the purpose of contacting you and sending information on the activities
of the above foundations. You can exercise your rights to  access to
personal data, rectification, erasure, restriction of processing, data
portability and object by contacting the following address: *l...@isglobal.org
*. ISGlobal Privacy Policy at *www.isglobal.org
*.


-

CONFIDENCIALIDAD. Este mensaje y sus anexos se dirigen exclusivamente a su
destinatario y puede contener información confidencial, por lo que la
utilización, divulgación y/o copia sin autorización está prohibida por la
legislación vigente. Si ha recibido este mensaje por error, le rogamos lo
comunique inmediatamente por esta misma vía y proceda a su destrucción.

PROTECCIÓN DE DATOS. Sus datos de carácter personal utilizados en este
envío, incluida su dirección de e-mail, forman parte de ficheros de
titularidad de la Fundación ISGlobal  para cualquier finalidades de
contacto, relación institucional y/o envío de información sobre sus
actividades. Los datos que usted nos pueda facilitar contestando este
correo quedarán incorporados en los correspondientes ficheros, autorizando
el uso de su dirección de e-mail para las finalidades citadas. Puede
ejercer los derechos de acceso, rectificación, supresión, limitación del
tratamiento, portabilidad y oposición dirigiéndose a *l...@isglobal.org
* . Política de privacidad en *www.isglobal.org
*.

-- 


This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege. 
If
you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly 
prohibited
by law. If this message has been received in error, please 
immediately notify
us via e-mail and delete it.



DATA PROTECTION. We 
inform you that your personal data, including your
e-mail address and data 
included in your email correspondence, are included in
the ISGlobal 
Foundation files. Your personal data will be used for the purpose
of 
contacting you and sending information on the activities of the above
foundations. You can exercise your rights of access, rectification,
cancellation and opposition by contacting the following address: 
l...@isglobal.org . ISGlobal
Privacy Policy at 
www.isglobal.org .



-

CONFIDENCIALIDAD. Este mensaje y sus anexos se dirigen exclusivamente a
su 
destinatario y puede contener información confidencial, por lo que la
utilización,
divulgación y/o copia sin autorización está prohibida por la
legislación
vigente. Si ha recibido este mensaje por error, le rogamos lo 
comunique
inmediatamente por esta misma vía y proceda a su destrucción.









PROTECCIÓN DE DATOS. Sus datos de carácter personal utilizados en este
envío, incluida su dirección de e-mail, forman parte de ficheros de 
titularidad
de la Fundación ISGlobal  para cualquier
finalidades de 
contacto, relación institucional y/o envío de información sobre
sus 
actividades. Los datos que usted nos pueda facilitar contestando este
correo quedarán incorporados en los correspondientes ficheros, autorizando 
el
uso de su dirección de e-mail para las finalidades citadas. 

Re: [R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Duncan Murdoch

On 17/03/2021 12:37 p.m., Luigi Marongiu wrote:

sorry, I don't get it...


Modify your rutledge function to print x, and you'll see the values of 
high printed.  x should be 1:45.


Duncan Murdoch



On Wed, Mar 17, 2021 at 2:35 PM Duncan Murdoch  wrote:


On 17/03/2021 6:59 a.m., Luigi Marongiu wrote:

yes, but in `rutledge` I model y as `y = (M / ( 1 + exp(-(x-m)/s)) ) +
B`, with x being 1:45. Isn't that the equivalent of what I fed Desmos
with? Tx


No, it's not.

Duncan Murdoch



On Wed, Mar 17, 2021 at 11:31 AM Duncan Murdoch
 wrote:


On 17/03/2021 5:41 a.m., Luigi Marongiu wrote:

Hello,
I have a dataset from a polymerase chain reaction. I am using the
equation given by Rutledge
(https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
does not match the data. I ran the same thing in Desmos and instead
the profile is correct (attached).
Why do I not get the same matching model as in Desmos? I believe the
formula in R is the same as the one in Desmos, and I am using the same
parameters.
Is there a procedure to debug models?
Thanks

Here is the code:
```
high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
  -14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 15.01,
  75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 5059.94,
  6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
  10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 11684.96,
  11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
plot(1:45, high, type = "l")
rutledge <- function(p, x) {
 m = p$half_fluorescence
 s = p$slope
 M = p$max_fluorescence
 B = p$back_fluorescence
 y = (M / ( 1 + exp(-(x-m)/s)) ) + B
 return(y)
}
desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
   max_fluorescence = 11839.8, back_fluorescence
= -138.864) , high)

points(1:45, desmos, type="l", col="blue")



In your calculation of desmos, you are using the Y variable for x in the
formula.  Calculate it this way instead:

desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
 max_fluorescence = 11839.8, back_fluorescence
= -138.864) , 1:45)

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, reproducible code.


Re: [R] library(hms)

2021-03-17 Thread John Fox

Dear Greg,

As I explained to you in a private email, and as others have told you, 
there is no Install.libraries() command, nor is there an 
install.libraries(0 command, but there is an install.packages() command.


So install.packages("hms") should work, on a Mac or on any other 
internet-connected computer on which R runs -- as you've also been told 
by others, this is not a Mac-specific issue. Note that the argument to 
install.packages must be quoted. See ?install.packages for details.


I'll also repeat the advice that I gave you privately to learn something 
about R before you try to use it, possibly starting with the "An 
Introduction to R" manual that ships with the standard R distribution.


Best,
 John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

On 2021-03-17 1:07 p.m., Gregory Coats wrote:

On my MacBook, I do not have, and do not know how to install, library(hms).
Greg Coats


library(hms)

Error in library(hms) : there is no package called ‘hms’

Install.libraries(“hms”)

Error: unexpected input in "Install.libraries(“"




__
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, reproducible code.


Re: [R] library(hms)

2021-03-17 Thread Gregory Coats via R-help
It appears that 
install.libraries(“hms”)
is unsuccessful, but that
install.packages(“hms”)
is successful.

install.packages("lubridate")
downloaded 1.5 MB
install.packages("hms")
downloaded 95 KB
install.packages("data.table")
downloaded 2.2 MB
Greg
> On Mar 17, 2021, at 1:07 PM, Gregory Coats via R-help  
> wrote:
> 
> On my MacBook, I do not have, and do not know how to install, library(hms).
> Greg Coats
> 
>> library(hms)
> Error in library(hms) : there is no package called ‘hms’
>> Install.libraries(“hms”)
> Error: unexpected input in "Install.libraries(“"
>> 
>   [[alternative HTML version deleted]]
> __
> 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, reproducible code.


[[alternative HTML version deleted]]

__
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, reproducible code.


Re: [R] library(hms)

2021-03-17 Thread Caitlin Gibbons
Your opening quote looks slightly different from the closing quote. This 
probably explains why you received the error message regarding “unexpected 
input”. 

I hope this helps. 


> On Mar 17, 2021, at 10:08 AM, Gregory Coats via R-help  
> wrote:
> 
> On my MacBook, I do not have, and do not know how to install, library(hms).
> Greg Coats
> 
>> library(hms)
> Error in library(hms) : there is no package called ‘hms’
>> Install.libraries(“hms”)
> Error: unexpected input in "Install.libraries(“"
>> 
>[[alternative HTML version deleted]]
> 
> __
> 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, reproducible code.

__
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, reproducible code.


Re: [R] [External] unanticipated axis labels

2021-03-17 Thread Richard M. Heiberger
exactly!
a warning when running would be very helpful.

Thank you.

Rich

> On Mar 17, 2021, at 02:41, Deepayan Sarkar  wrote:
> 
> On Tue, Mar 16, 2021 at 11:35 PM Richard M. Heiberger  wrote:
>> 
>> library(lattice)
>> library(latticeExtra)
>> 
>> barchart(matrix(c(1:6, 5:6)), main="unanticipated left axis labels", 
>> ylab="unanticipated inside labels") +
>>  latticeExtra::layer(panel.axis("left", half=FALSE, labels=1:8))
> 
> So to summarize, your problem case happens when you explicitly specify
> 'labels' but not 'at' in panel.axis(), right?
> 
> Unfortunately, this is not intended to work at all, so what you are
> seeing is undefined behaviour. This is hinted at, but not quite
> explicitly spelled out, in the documentation. I will fix that, and
> maybe add a warning as well.
> 
> -Deepayan
> 
>> barchart(matrix(c(1:6, 5:6)), main="ok 1", ylab="anticipated") +
>>  latticeExtra::layer(panel.axis("left", half=FALSE, labels=1:8, at=1:8))
>> 
>> barchart(matrix(c(1:6, 5:6)), main="ok 2", ylab="anticipated") +
>>  latticeExtra::layer(panel.axis("left", half=FALSE, at=1:8))
>> 
>> barchart(matrix(c(1:6, 5:6)), main="ok 3", ylab="anticipated") +
>>  latticeExtra::layer(panel.axis("left", half=FALSE))
>> 
>> 
>> 
>> __
>> 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, reproducible code.

__
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, reproducible code.


Re: [ESS] ESS failing to load from a directory outside the FHS

2021-03-17 Thread Sparapani, Rodney via ESS-help
In *scratch*, you can type load-path and C-j.
Or F1 v load-path return to see its contents.
But, it sounds like you might just want a fresh install
via MELPA or in your HOME directory 

-- 

Rodney Sparapani, Associate Professor of Biostatistics
Chair ISBA Section on Biostatistics and Pharmaceutical Statistics 
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus
 

On 3/17/21, 12:16 PM, "Steve Gutreuter"  wrote:

ATTENTION: This email originated from a sender outside of MCW. Use caution 
when clicking on links or opening attachments.


Thanks Rodney,

Sysadmins did the installation, which is when I presume everything was
byte-compiled.

At any rate, setting ess-etc-directory did not result in ESS loading.  I
still get the message "Error: Cannot open load file: No such file or
directory, ess.rd.el".  Yet, ess.rd.el is present. Naively, it looks to
me as if (add-to-list 'load-path "/apps/x86_64/emacs/ess-18.10.2/") is
not being executed.


On 3/17/21 11:36 AM, Sparapani, Rodney via ESS-help wrote:
> Hi Steve:
>
> Well, maybe you didn’t see my earlier post.  But, you
> should not need to byte-compile ESS to make it work.
> This error has to do with the anticipated directory
> structure that is being violated: “ERROR:ess-etc-directory”
> You can probably work-around that by something like…
> (setq ess-etc-directory “FILL THIS IN ACCORDINGLY”)
> --
> Rodney Sparapani, Associate Professor of Biostatistics
> Chair ISBA Section on Biostatistics and Pharmaceutical Statistics
> Institute for Health and Equity, Division of Biostatistics
> Medical College of Wisconsin, Milwaukee Campus
>
>
>   [[alternative HTML version deleted]]
>
> __
> ESS-help@r-project.org mailing list
> 
https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!p-soddQAA4_I_fQO8MuwRi_Ik93eCNiiuUb3H7Rfl-oJKNu0YfVWY-Hrbr6mx_M$

--
Steve Gutreuter


__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] library(hms)

2021-03-17 Thread Caitlin Gibbons
Maybe you used the wrong quotes with the parentheses? 

> On Mar 17, 2021, at 10:08 AM, Gregory Coats via R-help  
> wrote:
> 
> On my MacBook, I do not have, and do not know how to install, library(hms).
> Greg Coats
> 
>> library(hms)
> Error in library(hms) : there is no package called ‘hms’
>> Install.libraries(“hms”)
> Error: unexpected input in "Install.libraries(“"
>> 
>[[alternative HTML version deleted]]
> 
> __
> 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, reproducible code.

[[alternative HTML version deleted]]

__
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, reproducible code.


Re: [R] library(hms)

2021-03-17 Thread Mark Leeds
Hi: install.packages("hms") should work if you have R installed along with
an internet connection.

When you do above, if you get a message about other packages needing to be
installed, then use

install.packages("hms", dependencies = TRUE).





On Wed, Mar 17, 2021 at 1:08 PM Gregory Coats via R-help <
r-help@r-project.org> wrote:

> On my MacBook, I do not have, and do not know how to install, library(hms).
> Greg Coats
>
> > library(hms)
> Error in library(hms) : there is no package called ‘hms’
> > Install.libraries(“hms”)
> Error: unexpected input in "Install.libraries(“"
> >
> [[alternative HTML version deleted]]
>
> __
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
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, reproducible code.


Re: [ESS] ESS failing to load from a directory outside the FHS

2021-03-17 Thread Steve Gutreuter via ESS-help

Thanks Rodney,

Sysadmins did the installation, which is when I presume everything was 
byte-compiled.


At any rate, setting ess-etc-directory did not result in ESS loading.  I 
still get the message "Error: Cannot open load file: No such file or 
directory, ess.rd.el".  Yet, ess.rd.el is present. Naively, it looks to 
me as if (add-to-list 'load-path "/apps/x86_64/emacs/ess-18.10.2/") is 
not being executed.



On 3/17/21 11:36 AM, Sparapani, Rodney via ESS-help wrote:

Hi Steve:

Well, maybe you didn’t see my earlier post.  But, you
should not need to byte-compile ESS to make it work.
This error has to do with the anticipated directory
structure that is being violated: “ERROR:ess-etc-directory”
You can probably work-around that by something like…
(setq ess-etc-directory “FILL THIS IN ACCORDINGLY”)
--
Rodney Sparapani, Associate Professor of Biostatistics
Chair ISBA Section on Biostatistics and Pharmaceutical Statistics
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus


[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


--
Steve Gutreuter

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] library(hms)

2021-03-17 Thread Bill Dunlap
install.packages("hms")

A 'library' is a directory (aka folder) that contains installed
'packages'.  I.e., one installs packages into a library, but one does
not install a library.

-Bill

On Wed, Mar 17, 2021 at 10:08 AM Gregory Coats via R-help
 wrote:
>
> On my MacBook, I do not have, and do not know how to install, library(hms).
> Greg Coats
>
> > library(hms)
> Error in library(hms) : there is no package called ‘hms’
> > Install.libraries(“hms”)
> Error: unexpected input in "Install.libraries(“"
> >
> [[alternative HTML version deleted]]
>
> __
> 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, reproducible code.

__
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, reproducible code.


[R] library(hms)

2021-03-17 Thread Gregory Coats via R-help
On my MacBook, I do not have, and do not know how to install, library(hms).
Greg Coats

> library(hms)
Error in library(hms) : there is no package called ‘hms’
> Install.libraries(“hms”)
Error: unexpected input in "Install.libraries(“"
> 
[[alternative HTML version deleted]]

__
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, reproducible code.


Re: [R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Luigi Marongiu
sorry, I don't get it...

On Wed, Mar 17, 2021 at 2:35 PM Duncan Murdoch  wrote:
>
> On 17/03/2021 6:59 a.m., Luigi Marongiu wrote:
> > yes, but in `rutledge` I model y as `y = (M / ( 1 + exp(-(x-m)/s)) ) +
> > B`, with x being 1:45. Isn't that the equivalent of what I fed Desmos
> > with? Tx
>
> No, it's not.
>
> Duncan Murdoch
>
> >
> > On Wed, Mar 17, 2021 at 11:31 AM Duncan Murdoch
> >  wrote:
> >>
> >> On 17/03/2021 5:41 a.m., Luigi Marongiu wrote:
> >>> Hello,
> >>> I have a dataset from a polymerase chain reaction. I am using the
> >>> equation given by Rutledge
> >>> (https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
> >>> does not match the data. I ran the same thing in Desmos and instead
> >>> the profile is correct (attached).
> >>> Why do I not get the same matching model as in Desmos? I believe the
> >>> formula in R is the same as the one in Desmos, and I am using the same
> >>> parameters.
> >>> Is there a procedure to debug models?
> >>> Thanks
> >>>
> >>> Here is the code:
> >>> ```
> >>> high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
> >>>  -14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 
> >>> 15.01,
> >>>  75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 
> >>> 5059.94,
> >>>  6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
> >>>  10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 
> >>> 11684.96,
> >>>  11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
> >>> plot(1:45, high, type = "l")
> >>> rutledge <- function(p, x) {
> >>> m = p$half_fluorescence
> >>> s = p$slope
> >>> M = p$max_fluorescence
> >>> B = p$back_fluorescence
> >>> y = (M / ( 1 + exp(-(x-m)/s)) ) + B
> >>> return(y)
> >>> }
> >>> desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
> >>>   max_fluorescence = 11839.8, back_fluorescence
> >>> = -138.864) , high)
> >>>
> >>> points(1:45, desmos, type="l", col="blue")
> >>
> >>
> >> In your calculation of desmos, you are using the Y variable for x in the
> >> formula.  Calculate it this way instead:
> >>
> >> desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
> >> max_fluorescence = 11839.8, back_fluorescence
> >>= -138.864) , 1:45)
> >>
> >> Duncan Murdoch
> >>
> >
> >
>


-- 
Best regards,
Luigi

__
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, reproducible code.


Re: [R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Duncan Murdoch

On 17/03/2021 6:59 a.m., Luigi Marongiu wrote:

yes, but in `rutledge` I model y as `y = (M / ( 1 + exp(-(x-m)/s)) ) +
B`, with x being 1:45. Isn't that the equivalent of what I fed Desmos
with? Tx


No, it's not.

Duncan Murdoch



On Wed, Mar 17, 2021 at 11:31 AM Duncan Murdoch
 wrote:


On 17/03/2021 5:41 a.m., Luigi Marongiu wrote:

Hello,
I have a dataset from a polymerase chain reaction. I am using the
equation given by Rutledge
(https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
does not match the data. I ran the same thing in Desmos and instead
the profile is correct (attached).
Why do I not get the same matching model as in Desmos? I believe the
formula in R is the same as the one in Desmos, and I am using the same
parameters.
Is there a procedure to debug models?
Thanks

Here is the code:
```
high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
 -14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 15.01,
 75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 5059.94,
 6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
 10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 11684.96,
 11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
plot(1:45, high, type = "l")
rutledge <- function(p, x) {
m = p$half_fluorescence
s = p$slope
M = p$max_fluorescence
B = p$back_fluorescence
y = (M / ( 1 + exp(-(x-m)/s)) ) + B
return(y)
}
desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
  max_fluorescence = 11839.8, back_fluorescence
= -138.864) , high)

points(1:45, desmos, type="l", col="blue")



In your calculation of desmos, you are using the Y variable for x in the
formula.  Calculate it this way instead:

desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
max_fluorescence = 11839.8, back_fluorescence
   = -138.864) , 1:45)

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, reproducible code.


[ESS] ESS failing to load from a directory outside the FHS

2021-03-17 Thread Steve Gutreuter via ESS-help
I have been unable to get ESS to load into Emacs on a CentOS7 compute 
server on which software is installed in locations that are not part of 
the FHS.


Lines 99 and 100 of my .emacs file contain:

(add-to-list 'load-path "/apps/x86_64/emacs/ess-18.10.2/lisp/")
(require 'ess-site)

A full byte-compiled ESS installation exists in 
apps/x86_64/emacs/ess-18.10.2. I have tried with and without the final 
~lisp/, but neither works.


When byte-compiling my .emacs I get the following two related (I think) 
messages.  In the *Messages* buffer I get:


ERROR:ess-etc-directory
Relative to ess-lisp-directory, one of the following must exist:
../etc/ess, ../etc, ../../etc/ess or ./etc

And in the *Compile-log* buffer I get:

Compiling file /scicomp/home-pure/wqh4/.emacs at Wed Mar 17 08:25:49 2021
.emacs:100:1:Error: Cannot open load file: No such file or directory, 
ess-rd.el


Note that line 100 in .emacs contains (require 'ess-site). Further, both 
ess.rd.el and ess.rd.elc exist in /apps/x86_64/emacs/ess-18.10.2/lisp/ 
and I have read+write permissions on that directory.


So it *looks* like /apps/x86_64/emacs/ess-18.10.2/lisp/ is not actually 
being added to the load path.  Any tips?


Thanks in advance.

--
Steve Gutreuter

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Problem with the str_replace function

2021-03-17 Thread phil
Your help is much appreciated. I now understand what my problem was and 
can move forward.


Philip


On 2021-03-17 01:19, Hervé Pagès wrote:

Hi,

stringr::str_replace() treats the 2nd argument ('pattern') as a
regular expression and some characters have a special meaning when
they are used in a regular expression. For example the dot plays the
role of a wildcard (i.e. it means "any character"):

  > str_replace("aaXcc", "a.c", "ZZ")
  [1] "aZZc"

If you want to treat a special character literally, you need to escape
it with a double backslahe '\\':

  > str_replace(c("aaXcc", "aa.cc"), "a.c", "ZZ")
  [1] "aZZc" "aZZc"

  > str_replace(c("aaXcc", "aa.cc"), "a\\.c", "ZZ")
  [1] "aaXcc" "aZZc"

Turns out that parenthesis are also special characters so you also
need to escape them:

  > str_replace("aa(X)cc", "a(X)c", "ZZ")
  [1] "aa(X)cc"

  > str_replace("aa(X)cc", "a\\(X\\)c", "ZZ")
  [1] "aZZc"

There are plenty of example in the man page for str_replace() (see
'?str_replace') including examples showing the use of parenthesis in
the pattern.

Hope this helps,

H.


On 3/16/21 5:34 PM, p...@philipsmith.ca wrote:
I have a problem with the str_replace() function in the stringr 
package. Please refer to my reprex below.


I start with a vector of strings, called x. Some of the strings 
contain apostrophes and brackets. I make a simple replacement as with 
x1, and there is no problem. I make another simple replacement, x2, 
where the pattern string has an apostrophe. Again no problem. Then I 
make a third replacement, x3, where the pattern has opening and 
closing brackets and the function still works fine. Finally I make a 
replacement where the pattern has both an apostrophe and opening and 
closing brackets and the replacement does not work. I tried to solve 
this by putting backslashes before the apostrophe and/or the brackets, 
but that accomplished nothing. I am stumped.


# Reprex for str_replace problem

library(stringr)

x <- c(
   "Clothing and footwear",
   "Women's clothing",
   "Women's footwear (excluding athletic)",
   "Clothing accessories (belts and so on)",
   "Clothing and footwear",
   "Women's clothing",
   "Women's footwear (excluding athletic)",
   "Clothing accessories (belts and so on)"
)
x
x1 <- str_replace(x,
   "Clothing and footwear",
   "Clothing and shoes"
)
x1
x2 <- str_replace(x,
   "Women's clothing",
   "Women's clothing goods"
)
x2
x3 <- str_replace(x,
   "Clothing accessories (belts and so on)",
   "Clothing accessories")
x3
x4 <- str_replace(x,
   "Women's footwear (excluding athletic)",
   "Women's footwear")
x4

__
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, reproducible code.


__
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, reproducible code.


Re: [R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Luigi Marongiu
yes, but in `rutledge` I model y as `y = (M / ( 1 + exp(-(x-m)/s)) ) +
B`, with x being 1:45. Isn't that the equivalent of what I fed Desmos
with? Tx

On Wed, Mar 17, 2021 at 11:31 AM Duncan Murdoch
 wrote:
>
> On 17/03/2021 5:41 a.m., Luigi Marongiu wrote:
> > Hello,
> > I have a dataset from a polymerase chain reaction. I am using the
> > equation given by Rutledge
> > (https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
> > does not match the data. I ran the same thing in Desmos and instead
> > the profile is correct (attached).
> > Why do I not get the same matching model as in Desmos? I believe the
> > formula in R is the same as the one in Desmos, and I am using the same
> > parameters.
> > Is there a procedure to debug models?
> > Thanks
> >
> > Here is the code:
> > ```
> > high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
> > -14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 15.01,
> > 75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 5059.94,
> > 6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
> > 10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 
> > 11684.96,
> > 11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
> > plot(1:45, high, type = "l")
> > rutledge <- function(p, x) {
> >m = p$half_fluorescence
> >s = p$slope
> >M = p$max_fluorescence
> >B = p$back_fluorescence
> >y = (M / ( 1 + exp(-(x-m)/s)) ) + B
> >return(y)
> > }
> > desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
> >  max_fluorescence = 11839.8, back_fluorescence
> > = -138.864) , high)
> >
> > points(1:45, desmos, type="l", col="blue")
>
>
> In your calculation of desmos, you are using the Y variable for x in the
> formula.  Calculate it this way instead:
>
> desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
>max_fluorescence = 11839.8, back_fluorescence
>   = -138.864) , 1:45)
>
> Duncan Murdoch
>


-- 
Best regards,
Luigi

__
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, reproducible code.


Re: [R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Duncan Murdoch

On 17/03/2021 5:41 a.m., Luigi Marongiu wrote:

Hello,
I have a dataset from a polymerase chain reaction. I am using the
equation given by Rutledge
(https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
does not match the data. I ran the same thing in Desmos and instead
the profile is correct (attached).
Why do I not get the same matching model as in Desmos? I believe the
formula in R is the same as the one in Desmos, and I am using the same
parameters.
Is there a procedure to debug models?
Thanks

Here is the code:
```
high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
-14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 15.01,
75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 5059.94,
6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 11684.96,
11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
plot(1:45, high, type = "l")
rutledge <- function(p, x) {
   m = p$half_fluorescence
   s = p$slope
   M = p$max_fluorescence
   B = p$back_fluorescence
   y = (M / ( 1 + exp(-(x-m)/s)) ) + B
   return(y)
}
desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
 max_fluorescence = 11839.8, back_fluorescence
= -138.864) , high)

points(1:45, desmos, type="l", col="blue")



In your calculation of desmos, you are using the Y variable for x in the 
formula.  Calculate it this way instead:


desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
  max_fluorescence = 11839.8, back_fluorescence
 = -138.864) , 1:45)

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, reproducible code.


[R] modelling 4-parameter curve in R does not match data - how to proceed?

2021-03-17 Thread Luigi Marongiu
Hello,
I have a dataset from a polymerase chain reaction. I am using the
equation given by Rutledge
(https://pubmed.ncbi.nlm.nih.gov/15601990/) but the profile I get in R
does not match the data. I ran the same thing in Desmos and instead
the profile is correct (attached).
Why do I not get the same matching model as in Desmos? I believe the
formula in R is the same as the one in Desmos, and I am using the same
parameters.
Is there a procedure to debug models?
Thanks

Here is the code:
```
high <- c(120.64, 66.14, 34.87, 27.11, 8.87, -5.8, 4.52, -7.16, -17.39,
   -14.29, -20.26, -14.99, -21.05, -20.64, -8.03, -21.56, -1.28, 15.01,
   75.26, 191.76, 455.09, 985.96, 1825.59, 2908.08, 3993.18, 5059.94,
   6071.93, 6986.32, 7796.01, 8502.25, 9111.46, 9638.01, 10077.19,
   10452.02, 10751.81, 11017.49, 11240.37, 11427.47, 11570.07, 11684.96,
   11781.77, 11863.35, 11927.44, 11980.81, 12021.88)
plot(1:45, high, type = "l")
rutledge <- function(p, x) {
  m = p$half_fluorescence
  s = p$slope
  M = p$max_fluorescence
  B = p$back_fluorescence
  y = (M / ( 1 + exp(-(x-m)/s)) ) + B
  return(y)
}
desmos <- rutledge(list(half_fluorescence = 27.1102, slope = 2.76798,
max_fluorescence = 11839.8, back_fluorescence
= -138.864) , high)

points(1:45, desmos, type="l", col="blue")
```

-- 
Best regards,
Luigi
__
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, reproducible code.


Re: [R] How to plot dates

2021-03-17 Thread PIKAL Petr
Hi

install.packages("lubridate") does not work on Mac?

Cheers
Petr


> -Original Message-
> From: R-help  On Behalf Of Gregory Coats
> via R-help
> Sent: Wednesday, March 17, 2021 1:11 AM
> To: Daniel Nordlund 
> Cc: r-help mailing list 
> Subject: Re: [R] How to plot dates
> 
> Dan, Thank you for this guidance.
> Unfortunately, I do not have the library lubridate, and I do not at this
> moment know where to go to get this library for an Apple MacBook.
> 
> > library(lubridate)
> Error in library(lubridate) : there is no package called ‘lubridate’
> 
> Greg Coats
> Reston, Virginia USA
> 
> > On Mar 16, 2021, at 7:49 PM, Daniel Nordlund 
> wrote:
> >
> > # create timepart variable - tme
> > library(lubridate)
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> 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, reproducible code.
__
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, reproducible code.


Re: [R] unanticipated axis labels

2021-03-17 Thread Deepayan Sarkar
On Tue, Mar 16, 2021 at 11:35 PM Richard M. Heiberger  wrote:
>
> library(lattice)
> library(latticeExtra)
>
> barchart(matrix(c(1:6, 5:6)), main="unanticipated left axis labels", 
> ylab="unanticipated inside labels") +
>   latticeExtra::layer(panel.axis("left", half=FALSE, labels=1:8))

So to summarize, your problem case happens when you explicitly specify
'labels' but not 'at' in panel.axis(), right?

Unfortunately, this is not intended to work at all, so what you are
seeing is undefined behaviour. This is hinted at, but not quite
explicitly spelled out, in the documentation. I will fix that, and
maybe add a warning as well.

-Deepayan

> barchart(matrix(c(1:6, 5:6)), main="ok 1", ylab="anticipated") +
>   latticeExtra::layer(panel.axis("left", half=FALSE, labels=1:8, at=1:8))
>
> barchart(matrix(c(1:6, 5:6)), main="ok 2", ylab="anticipated") +
>   latticeExtra::layer(panel.axis("left", half=FALSE, at=1:8))
>
> barchart(matrix(c(1:6, 5:6)), main="ok 3", ylab="anticipated") +
>   latticeExtra::layer(panel.axis("left", half=FALSE))
>
>
>
> __
> 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, reproducible code.

__
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, reproducible code.