similar to: sources of code; was Generate random numbers in Fortran

Displaying 20 results from an estimated 1100 matches similar to: "sources of code; was Generate random numbers in Fortran"

2011 Oct 06
2
Titles changing when a plot is redrawn
I ran into a problem with titles on graphs. I wanted a graph with multiple subplots, with each having a title that involved both a Greek letter and an identifier for each graph. Below is a simplified version of code to do this. The graph appears fine, with the first graph having "i=1" in the title, and the second graph having "i=2" in the title. However, when I resize the
2016 Dec 08
2
require(..., quietly=TRUE) does not suppress warning
Hi, The `quietly` argument of `require` is documented as follows: quietly: a logical. If ?TRUE?, no message confirming package attaching is printed, and most often, no errors/warnings are printed if package attaching fails. However: > require(foo, quietly=TRUE) Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
2012 Jun 24
2
Win 64 package build - ERROR: loading failed for 'x64'
I have developed an R package that works under Win32, but when I attempt to build it on Win64, I get ERROR: loading failed for 'x64' More precisely, I developed and tested the package under Win32 and it works. But when I move to a 64 bit Windows 7 (Home Premium) system, and attempt to build both 32 bit and 64 bit packages, the 32 bit package seems to build, but the 64 bit build
2016 Dec 08
1
require(..., quietly=TRUE) does not suppress warning
Well, I'm getting a warning (not an error) when the package doesn't exist. I interpreted "most often" to mean that suppressing warnings/errors is why you'd most often use this argument, as most packages don't emit startup messages. And technically there isn't a problem with attaching the package, since we don't even try to attach packages that don't exist.
2016 Dec 08
3
wish list: generalized apply
Dear All, I regularly want to "apply" some function to an array in a way that the arguments to the user function depend on the index on which the apply is working. A simple example is: A <- array( runif(160), dim=c(5,4,8) ) x <- matrix( runif(32), nrow=4, ncol=8 ) b <- runif(8) f1 <- function( A, x, b ) { sum( A %*% x ) + b } result <- rep(0.0,8) for (i in 1:8) {
2008 Jun 06
1
calling a C function with a struct
I am trying to call a precompiled C function that uses a struct as one of it's arguments. I could write a wrapper function in C, but I was hoping there is some way to pack fields into an array of type raw that could be passed directly to the function. Here is some more detail. The C struct is simple, but has mixed types: struct STRUCT1 { long type; long nx; double
2010 Jun 17
2
constrOptim( ): conflict between help page and code
There is a contradiction between what the help page says and what constrOptim actually does with the constraints. The issue is what happens on the boundary. The help page says The feasible region is defined by ?ui %*% theta - ci >= 0?, but the R code for constrOptim reads if (any(ui %*% theta - ci <= 0)) stop("initial value not feasible") The following example
2009 Sep 29
1
Probability of data values form empirical distribution
Hello,   Could someone help me please and to tell how to get the probability from empirical distribution (not parametric) for each data value (R function). For example, for normal distribution there is such a function like:   “pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”   I need the same function only for the empirical distribution (which does not correspond to any typical
2009 Sep 29
1
Probability of data values form empirical distribution
Hello,   Could someone help me please and to tell how to get the probability from empirical distribution (not parametric) for each data value (R function). For example, for normal distribution there is such a function like:   “pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”   I need the same function only for the empirical distribution (which does not correspond to any typical
2005 Aug 30
2
problem in generating positive stable random numbers
Dear all, I am trying to use the rstable(n, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2))) function to generate positive stable random numbers. For positive stable distribution, beta==1 and alpha is in (0,1), which defines random variables with support (0, infinity). So, I used rstable(100, 0.5, 1) for an example. I found that this gives me some negative numbers. For example, >
2015 Jan 08
4
RFC: getifexists() {was [Bug 16065] "exists" ...}
If we do add an argument to get(), then it should be named consistently with the ifnotfound argument of mget(). As mentioned, the possibility of a NULL value is problematic. One solution is a sentinel value that indicates an unbound value (like R_UnboundValue). But another idea (and one pretty similar to John's) is to follow the SYMSXP design at the C level, where there is a structure that
2011 Nov 18
0
how to define the bound between parameters in nls() (Jinsong Zhao)
The multiple exponential problem you are attempting has a well-known and long history. Lanczos 1956 book showed that changing the 4th decimal in a data set changes the parameters hugely. Nevertheless, if you just need a "fit" and not reliable paramters, you could reparameterize to k1 and k2diff=k2-k1, so k2=k1+kdiff. Then kdiff has a lower bound of 0, though putting 0 will almost
2002 Nov 05
0
3 or 4 level Split plot
As an agronomist, sometimes i need to perform statistical analisys on "weird" field data, like 3 or 4 level split plot design. I've read both the help of the program, some books and manual about S and "Venables/Ripley, Modern Applied Statistics with S", but i still have problems in (i suppose) formulae sintax. I'm trying to perform AOV, as explained showed in
2002 Nov 11
0
AOV and general formula sintax
As an agronomist, sometimes i need to perform statistical analisys on "weird" field data, like 3 or 4 level split plot design. I've read both the help of the program, some books and manual about S and "Venables/Ripley, Modern Applied Statistics with S", but i still have problems in (i suppose) formulae sintax. I'm trying to perform AOV, as explained in "Random
2018 Mar 23
1
Integrate erros on certain functions
In the help for ?integrate: >When integrating over infinite intervals do so explicitly, rather than just using a large number as the endpoint. This increases the chance of a correct answer ? any function whose integral over an infinite interval is finite must be near zero for most of that interval. I understand that and there are examples such as: ## a slowly-convergent integral integrand
2010 Dec 06
3
0.5 != integrate(dnorm,0,20000) = 0
Hello: The example "integrate(dnorm,0,20000)" says it "fails on many systems". I just got 0 from it, when I should have gotten either an error or something close to 0.5. I got this with R 2.12.0 under both Windows Vista_x64 and Linux (Fedora 13); see the results from Windows below. I thought you might want to know. Thanks for all your work in creating
2014 May 07
3
historical significance of Pr(>Chisq) < 2.2e-16
Where does the value 2.2e-16 come from in p-values for chisq tests such as those reported below? > Anova(cm.mod2) Analysis of Deviance Table (Type II tests) Response: Freq LR Chisq Df Pr(>Chisq) B 11026.2 1 < 2.2e-16 *** W 7037.5 1 < 2.2e-16 *** Age 886.6 8 < 2.2e-16 *** B:W 3025.2 1 < 2.2e-16 *** B:Age 1130.4 8 < 2.2e-16 *** W:Age 332.9 8 < 2.2e-16 *** --- Signif.
2015 Apr 29
4
R CMD check and missing imports from base packages
On Wed, Apr 29, 2015 at 1:45 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote: > Gabor, > > To play devil's advocate a bit, why not just have the package formally > import the functions it wants to use (or the whole package if that is > easier)? > This is exactly my goal. And to facilitate this, R CMD check could remind you if you forgot to do the formal import.
2010 Nov 17
1
Please, help me with 'mattern' variogram
Hi, R-folks: I have been tryin many combination of parameter to make Matern variogram to work, but I can't find the available one. I'm near to be crazy. I tiped: A?o2003Selg.lf<-likfit(A?o2003Selg,cov.model="matern",ini.cov.pars=c(1.5,14),kappa=2.5,fix.kappa=FALSE,nugget=0.08,lambda=0.008,fix.lambda=FALSE,hessian=TRUE) the hessian shows: $hessian [,1]
2008 May 15
1
logistic transformation using nlminb
Dear all, I want to find the optimal values of a vector, x (with 6 elements) say, satisfying the following conditions: 1. for all x>=0 2. sum(x)=1 3. x[5]<=0.5 and x[6]<=0.5 For the minimisation I'm using nlminb and to satisfy the first 2 conditions the logistic transformation is used with box constraints for condition 3. However, I don't seem to be able to get the values x