Why sometimes one has to put a double
backslash in regular expressions, but
often simple backslashes work too?
Is only a \ required for giving a
metacharacter its usual meaning?
---
u=grep('\\{[\\-u]x',a,perl=T)
# equivalent to
Mario Morales wrote:
I need to draw a circle
I would do it with complex numbers
and polar coordinates:
Circle = function (t,a)
{a*cos(t)+1i*a*sin(t)}
interval=c(-8,8)
plot(interval,interval,type=n,xlab=,ylab=,
asp=1,axes=F)
t=seq(0,2*pi,by=0.01)
center=2+3i; radius=5
I have two questions about data frames:
(1) How can one extract a simple matrix
from a data frame? I tried
Matrixfromdf = function (frame,without=1)
{a=frame[colnames(frame)[-without]]
v=unlist(a,use.names=F)
matrix(v,ncol=ncol(a))}
but it works well only for without=1,
perhaps
Perhaps this works for creating a new void dataframe:
Newvoid = function (...)
{a=c(...); m=length(a)
initial=matrix(rep(NA,m),byrow=T,ncol=m)
tab=data.frame(initial)
colnames(tab)=a; subset(tab,F)}
Josef Eschgfäller
--
Josef Eschgfäller
Dipartimento Matematico
Universita' di Ferrara
How precise is R numerically? For example I
wrote the following function for calculating
the volume of the ball inscribed in the
unit cube in m dimensions. In order to see what
happens in 40 dimensions, I created an output
of 24 digits. But how many are precise?
Thanks
Josef Eschgfäller
Ferrara
~/.Rprofile
You could also write in .Rprofile soemthing like this:
for (x in dir(Mylibrary,full.names=T,recursive=T))
source(x)
where Mylibrary is a directory which
contains your functions without making a package.
Josef Eschgfäller__
Leaving an object `x' around from .Rprofile is not at all a good idea,
Actually I thought to put it inside a function.
Josef Eschgfäller
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
I'm trying to write some GMP functions but am not sure about
how and where to use pointers.
--
// alfa.c
# include R.h
# include gmp.h
void Createinteger (char *A, mpz_t *N)
{mpz_init(*N); mpz_set_str(*N,A,10);}
void