similar to: date operations

Displaying 20 results from an estimated 6000 matches similar to: "date operations"

2017 May 09
2
registering Fortran routines in R packages
Dear list, I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics. Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
2017 May 10
3
registering Fortran routines in R packages
Thanks for your email. I try to change the name in lowercase but it conflicts with a C implementation also named halton. So I rename the C function halton2() and sobol2() while the Fortran function are HALTON() and SOBOL() (I also try lower case in the Fortran code). Unfortunately, it does not help since I get init.c:97:25: error: use of undeclared identifier 'halton_'; did you mean
2009 Sep 19
1
generic methods - in particular the summary function
Hi all, I'm currently working on the fitdistrplus package (that basically fit distributions). There is something I do not understand about the generic function summary. In the current version on CRAN, there is no NAMESPACE saying S3method(summary, fitdist) . However if we use summary on an object send by fitdist function it works fine... According to R-lang, we have " The most
2015 Sep 17
1
names treatment in optim()
Dear both, I have found that names are not treated in the same way in optim() depending on the optimization method (argument method). The example below shows the difference between the Brent method and the L-BFGS-B method. f <- function(x){ y <- x^2;names(y) <-"f(x)";y} optim(10, f, method="Brent", lower=-1, upper=10)$value optim(10, f, method="L-BFGS-B",
2009 Apr 29
3
legend with small colored boxes
Hi all, I tried to a nice legend with small boxes filled with the colors used for the plots. But it does nor work, boxes are always filled with black. An example is here plot(1:4,1:4) lines(1:4,4:1, col="blue") legend("top",leg=c("a","b"),col=c("black","blue"), fill=TRUE) How could I specify the colors? the argument col.box is the
2009 May 10
2
Vignettes with missing or empty \VignetteIndexEntry:
Hi, I have a problem when checking the package 'probdistr' (on probability distributions). I got this warning * checking index information ... WARNING Vignettes with missing or empty \VignetteIndexEntry: [1] "probdistr-chi" "probdistr-contextra" "probdistr-discrete" [4] "probdistr-discrextra" "probdistr-exp"
2017 May 10
1
registering Fortran routines in R packages
Have you tried using tools:::package_native_routine_registration_skeleton()? If you don't like its output, you can easily edit its results and still avoid most pitfalls. Cheers, Jari Oksanen ________________________________________ From: R-devel <r-devel-bounces at r-project.org> on behalf of Berend Hasselman <bhh at xs4all.nl> Sent: 10 May 2017 09:48 To: Christophe Dutang Cc:
2009 Apr 27
1
problem with symbol function
Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The
2009 Nov 13
2
AR(2) modelling
Hi useRs, I'm trying to fit a basic AR(2) model with the 'ar' function. And when I try to check the value of the coefficients, I could not find the same value as the 'ar' function. Here is my example: myserie <- c(212, 205, 210, 213, 217, 222, 216, 218, 220, 212, 215, 236) #plot(myserie, type="l") myserieminus0 <- tail(myserie, -2) myserieminus1 <-
2009 Nov 13
2
AR(2) modelling
Hi useRs, I'm trying to fit a basic AR(2) model with the 'ar' function. And when I try to check the value of the coefficients, I could not find the same value as the 'ar' function. Here is my example: myserie <- c(212, 205, 210, 213, 217, 222, 216, 218, 220, 212, 215, 236) #plot(myserie, type="l") myserieminus0 <- tail(myserie, -2) myserieminus1 <-
2009 Jul 30
1
rowSums, rowMean and rowCumSums?
Dear list, Don't you think it could be useful to have in R base a function rowCumSums, that compute cumulative sums for each row of a matrix? My implementation of rowCumSums is rowCumSums <- function(x) t(mapply(function(row)cumsum(x[row,]), 1:NROW(x))) I'm sure it can be improved to have other arguments like na.rm or dims. Is there any hope to have this function in R?
2009 Feb 22
2
R tutorial
Dear all, I have just found a 'good' tutorial R for datamining. I think it should be on the contributed docs. http://cran.r-project.org/other-docs.html Here is the link http://www.liaad.up.pt/~ltorgo/DataMiningWithR/ What do you think? Kind regards Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
2013 Mar 11
2
vertical lines in R plot
Dear All, May I seek your suggestion on a simple issue. I want to draw vertical lines at some positions in the following R plot. To be more specific, I wish to draw vertical lines at d=c(5.0,5.5,6) and they should go till p=c(0.12,0.60,0.20) . I haven't found any way out, though made several attempts. Please run the following commands first if you are interested in!
2010 Aug 06
1
on the optim function
Dear useRs, I have just discovered that the R optim function does not return the number of iterations. I still wonder why line 632-634 of optim C, the iter variable is not returned (for the BFGS method for example) ? Is there any trick to compute the iteration number with function call number? Kind regards Christophe -- Christophe Dutang Ph.D. student at ISFA, Lyon, France website:
2012 Oct 23
1
Minimizing Computational Time
Dear R-users, May I seek some suggestions from you. I have a long programme written in R with several 'for' loops inside. I just want to get them out by any elegant way (if there is!) to reduce the computational time of the main programme. For instance, is there any smart way for the following programme that will lessen time?
2005 Feb 27
2
Help with constrained optimization
Dear all, I need an advice in the following problem. I have to maximize two functions of the form f1(x)=f(y1,x,alpha1,beta1) and f2(x)=(y2,x,alpha2,beta2), the maximization is with respect to alpha1, alpha2, beta1, beta2. I can maximize each function separately using nlm. The problem is that I have to add the constraint of the form g(alpha1)=g(alpha2). The total number of parameters is
2011 Apr 19
1
An update of the Distribustions man page
Dear list, I would like to suggest a small update the ?Distributions man page of the stats package. The current version contains the following line. The CRAN package \pkg{SuppDists} for additional distributions. I think it would be better to put in this man page a link to the CRAN task view on Distributions http://cran.r-project.org/web/views/Distributions.html. It is not true that the
2015 Jan 23
1
Programming Tools CTV
Dear Willem, Personally, I use the R-forge project for the distribution CTV : https://r-forge.r-project.org/projects/ctv/ It?s an alternative option to github. Regards, Christophe --------------------------------------- Christophe Dutang LMM, UdM, Le Mans, France web: http://dutangc.free.fr Le 23 janv. 2015 ? 12:49, Luca Braglia <lbraglia at gmail.com> a ?crit : > Hi Willem >
2023 Apr 08
1
Error message for infinite probability parameters in rbinom() and rmultinom()
Dear all, Using rmultinom() in a stochastic model, I found this function returns an error message 'NA in probability' for an infinite probability. Maybe, a more precise message will be helpful when debugging. > rmultinom(1, 3:5, c(1/2, 1/3, Inf)) Error in rmultinom(1, 3:5, c(1/2, 1/3, Inf)) : NA in probability vector > rmultinom(1, 3:5, c(1/2, 1/3, NA)) Error in rmultinom(1,
2009 Jul 21
1
thousands separator
Dear useRs, I was wondering how to deal with data where thousands separator is a space or a comma? with google, I thought I found the answer but the thread ( http://tolstoy.newcastle.edu.au/R/help/06/04/25524.html) just focuses on decimal separator. Is there any function to numbers written like this in a csv file? Thanks in advance Christophe -- Christophe DUTANG Ph. D. student at ISFA