[R] Latex fonts in R graphics

2010-09-11 Thread KARAVASILIS GEORGE
Hello, R users. I am trying to embed Computer modern fonts to an R plot and I get the following error. CM - Type1Font(CM, + c(paste(cm-lgc/fonts/afm/public/cm-lgc/, + c(fcmr8a.afm, fcmb8a.afm, fcmri8a.afm, fcmbi8a.afm), sep=), + ./cmsyase.afm)) pdf(cm.pdf, width=3, height=3,

[R] Tex fonts in R plots

2009-07-07 Thread KARAVASILIS GEORGE
Hello, R users. I would like to display the font of Math Mode of MikTex 2.3, WinEdt 5.4 in R plots, e.g. in xlab, ylab or legend. How can I do that? Thank you in advance. __ R-help@r-project.org mailing list

[R] mapply

2009-05-30 Thread KARAVASILIS GEORGE
Hello, R users. I would like to count the number of triples (r_i, s_j, t_k) with r_i, s_j, t_k distinct and abs((r_i-t_k)-u)=0 and abs((s_j-t_k)-v)=0, where r_i, s_j, t_k are the elements of three vectors a,b,c with different lengths and u,v=1:n. I have solved this problem writing a subroutine

[R] avoid a loop

2009-05-28 Thread KARAVASILIS GEORGE
Hello, R users. I have the following code: a=1:10 b=-3:15 n=5 x - rep(0,n) for (i in 1:n) x[i] - sum( outer(a,b, function(s,t) abs(a-b-i)==0) ) Can someone tell me if I could avoid the for command? Thank you in advance. __ R-help@r-project.org

[R] definition of a function

2008-10-28 Thread KARAVASILIS GEORGE
Hello, R subscribers. I would like to define a function like this one: Fun - function(x)sin(x)/x with value 1 at x=0. How can I do that? Is there a way to plot it symbolically, without using x as a vector? e.g. x - seq(from=-10, to=10, length=100) plot(x, Fun(x)) Thank you in advance.