Displaying 20 results from an estimated 3000 matches similar to: "One package calling C-code from another package."
2002 May 18
5
Length of a string
Hi,
Suppose I have created something like this in R:
foo <- "myfoo"
and I want to find out the number of character in foo (in other words, R
should return 5 since "myfoo" has 5 charactors.
How can I do it? I tried:
length(foo)
but it returned 1.
Cheers,
Kevin
------------------------------------------------------------------------------
Ko-Kang Kevin Wang
2002 Feb 13
3
pnorm, relative accuracy in the tails
Dear R people
The function below should be decreasing, convex, and tend to zero when x
tends to infinity.
curve((1-pnorm(x))/dnorm(x),from=0, to=9)
>From the plot we see that for x between 8.0 and 8.3 the function is
fluctuating.
As far as I understand, this is due to the function pnorm() not being
sufficiently accurate in the tails.
I am using pnorm() in a way that has probably not been
2002 May 06
3
function sort.list()
Derar R-people
I have troubles understanding what the function sort.list() is doing. On
the homepage it says that it returns a permutation which rearranges a
vector into ascending or descending order (like order() but on a vector
instead of a sequence).
> sort.list(c(0, 2, 10, 11, 4))
[1] 1 2 5 3 4
which does not make sense to me.
In fact I am getting the same (non-sensical) result using
2002 Feb 23
4
bug in options() - help page (PR#1323)
Dear R-developers
There is a discrepancy between the variables found by typing
names(options()) and the variables described on the help page for the
function ``options''.
The following variables are in names(options()) but not described on the
help page :
"error.messages"
"repositories"
"show.coef.Pvalues"
"help.try.all.packages"
2002 Jul 30
1
Optim() returns wrong maximum
Dear R-devel
During the last half a year I have several times encountered the
following problem with optim() when using method= "L-BFGS-B".
The function return a value which is clearly not the maximum (seen from
printing the value each time the function is called). Some output is
shown below.
A few things I have observed (as I remember it):
a. The problem seems to occur when the
2002 Jan 19
1
correlated random effects in GLMMGibbs ?
Dear R-users,
I wondered if anyone has extended GLMMGibbs to include correlated
random effects, and if so, whether they would be willing to let me
use their code?
Jonathan Myles has no plans to extend glmm in this manner within the
foreseeable future.
With thanks,
Patty
--
--------------------------------------------------------------------------------
Assoc Prof Patty Solomon
2002 Apr 15
2
krige and polygon limit problem
Dear all,
I'm new on R and this mailing list. We work on spatial rainfall estimation
with R and Grass.
We have a problem with the krige function from the sgeostat package. We would
like to limit the estimated area with a polygon limit.
I use a 50 points polygon to describe my work area. The krige function work
quiet well without limit. But if I use this option I have the following error
2002 May 28
1
determination of the number of lags
Dear all,
I wish use the "est.variogram" function under R.
My question concerns the determination of number of lags.
To make this calculation, i determined the biggest and the smallest
distance between 2 pairs of points.
I built the following tolerance : tol=mindistance/2 and i defined 1 lag as
: 1lag=mindist+tol.
Then i made a buckle the step of stop of which the maximal distance.
2002 Aug 21
1
is.numeric()
Dear R-list
I am having troubles understanding how the function is.numeric() works.
Any help appreciated.
Some commands are given here (the output and my comments are given
below)
vec <- c(1.4, NA, NA, NA)
sapply(vec,FUN=is.numeric)
is.numeric(vec[2])
is.na(vec[2])
is.numeric(NA)
vec <- c(TRUE, FALSE, NA, NA)
sapply(vec,FUN=is.numeric)
is.numeric(vec[2])
is.numeric(vec[3])
2002 Feb 22
2
errors in integrate function?
I have been trying the integrate function in R, a function which would be
very useful for a current project of mine. But I am encountering errors
integrating the one function I have tried. The function to be integrated is
a product of a gamma demsity and a normal density:
gamma.by.normal_function(y,x,shape,scale,stdev)
return( dgamma(y,shape=shape,scale=scale)*
2002 Mar 01
1
fft
Hi,
I have problems when calling fft_factor and fft_work directly in my
C-code. Martin Maechler already told me that I should not do this --
anyway, the code works fine if the length of the vector is a multiple
of 2,3,5.
If the length of the vector has different form I get, in some cases, a
segmentation fault when work and iwork are freed (I use C's malloc to
allocate memory for work and
2002 May 21
3
how to extrac one coef from lm at a time
Hello R-Users,
I have I simple question that I could not solve:
How to extract the elevation and the slope values from a linear model (lm)
separately?
coef(model.lm) gives both of them.
Thanks,
Antonio Olinto
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2002 Apr 17
2
nls error control
I'm running a simulation that uses nls on each run. Sometimes, not
unexpectedly, nls doesn't return parameter estimates (e.g., "singular
gradient" error). Of course when this happens the simulation (in a loop)
stops and no results are recorded. What I would like is for the simulation
to simply record that nls couldn't obtain estimates on a particular run due
to whatever
2002 May 29
3
inverse gaussian random numbers
Dear R-people
Does someone have a routine to ngenerate inverse-gaussian random
numbers. I am thinking of
something similar to rinvgauss, pinvgauss etc. in S-plus.
best regards
Helgi
--
Helgi Tomasson FAX: 354-552-6806
University of Iceland PHONE:354-525-4571
Faculty of Economics and Business Administration
2002 Jun 15
2
using integrate on a function defined with if
Dear R People,
I getting some curious behaviour with the integrate function. Consider the
function
foo <- function(x)
{
if(x==0)
4
else
0
}
I get the error
> integrate(foo,0,1)
Error in integrate(foo, 0, 1) : evaluation of function gave a result of
wrong length
But now consider
foo <- function(x)
{
ifelse(x==0,4,0)
}
> integrate(foo,0,1)
0 with absolute error
2002 May 06
3
Viewing certain numbers without NA's
Dear R Community,
We have recently installed R 1.5.0 on several workstations. Ever since,
if I try to extract certain numbers or lines from a file (which contains
many NA's), I don't only get my desired line but all other lines which
contain NA's. In a file with 15000 rows and 7500 NA's this is not very
practical. In the earlier R-Version this worked when I typed in the
2002 Apr 11
3
new acf package
I'm a PhD student and I'm working with covariance function. I'm interested
to know if exist some packages in R to calculate and plot the
bidimensional Autocovariance Function. the input matrix is a matrix that
describe a spatial location over a 2-D space and I want to use it in the
same way I can use a time serie in the 1-D acf.
Thanks,
Nicola.
2002 Apr 11
3
new acf package
I'm a PhD student and I'm working with covariance function. I'm interested
to know if exist some packages in R to calculate and plot the
bidimensional Autocovariance Function. the input matrix is a matrix that
describe a spatial location over a 2-D space and I want to use it in the
same way I can use a time serie in the 1-D acf.
Thanks,
Nicola.
2004 Mar 05
4
Command Line Expressions
Hi,
Is it possible to run R in command line to evalute R expressions
and return results to stdout, something like
>R CMD -e "R.version$minor"
then you got return
>"8.1"
Or do a simple calculation
>R CMD -e "sin(1.2)"
>0.932039
Thanks.
--
Pingping Zheng
Department of Mathematics and Statistics
Fylde College
Lancaster University
Lancaster LA1 4YF
2002 Jun 18
5
insert number in vector
Hello R-users,
I need to create a vector inserting an 1 after each value of another vector.
For example:
vec1<-c(2,3,4)
I need to create a vector with the values 2,1,3,1,4
Does anyone know how create this vector without loops (vec1 could have 1000
elements)
Thank you,
Juan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read