RE: [R] plot
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] wrote: Can anyone tell me how to plot on the same graph two different functions (of x) using two differnt y scales (axes 2 and 4)? The only way I've found is to use the grid library and push.viewport(). ((...) means substitute with whatever appropriate, use help()) library(grid) grid.newpage() push.viewport(viewport(yscale=c(0,500),w=.75,h=.75,xscale=c(0:100))) grid.poins(...) # Plots data point with an y-scale of 0-500 grid.xaxis(...) grid.yaxis(...) # Draws the left y-axis push.viewport(viewport(yscale=c(0,10),xscale=c(0:100))) grid.poins(...) # Plots data point with an y-scale of 0-10 grid,yaxis(main=FALSE,...) # Draws the right y-axis Morten -- Morten Sickel Norwegian Radiation Protection Authority http://www.nrpa.no __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] search function
On 03/17/03 07:20, Laurent Gautier wrote: On Mon, Mar 17, 2003 at 01:50:03AM -0400, pingzhao wrote: Could any one tell me there is a search function for R-help Archives? http://www.r-project.org/search.html Also in my page below. -- Jonathan Baron, Professor of Psychology, University of Pennsylvania R page: http://finzi.psych.upenn.edu/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] plot
Hi On 17 Mar 2003 at 9:06, Morten Sickel wrote: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] wrote: Can anyone tell me how to plot on the same graph two different functions (of x) using two differnt y scales (axes 2 and 4)? The only way I've found is to use the grid library and push.viewport(). ((...) means substitute with whatever appropriate, use help()) library(grid) grid.newpage() push.viewport(viewport(yscale=c(0,500),w=.75,h=.75,xscale=c(0:100))) grid.poins(...) # Plots data point with an y-scale of 0-500 grid.xaxis(...) grid.yaxis(...) # Draws the left y-axis push.viewport(viewport(yscale=c(0,10),xscale=c(0:100))) grid.poins(...) # Plots data point with an y-scale of 0-10 grid,yaxis(main=FALSE,...) # Draws the right y-axis Or maybe this small function which I use for 2 (different scale) y axes can make it on ordinary graphic device. You has to provide 3 vectors x, yright and yleft and you can put lines through linky=T or/and smoothed lines through setting smooth 0. plot.yy-function(x,yright,yleft, xlab = NULL ,yylab=c(,),pch=c(1,2),col=c(1,2), linky=F, smooth=0, lwds=1, ...) { par(mar=c(5,4,4,2),oma=c(0,0,0,3)) plot(x,yright,axes=F,ylab=, xlab=xlab, pch=pch[1],col=col[1], ...) axis(4,pretty(range(yright,na.rm=T),10),col=col[1]) if (linky) lines(x,yright,col=col[1], ...) if (smooth!=0) lines(supsmu(x,yright,span=smooth),col=col[1], lwd=lwds, ...) if(yylab[1]==) mtext(deparse(substitute(yright)),side=4,outer=T,line=1, col=col[1], ...) else mtext(yylab[1],side=4,outer=T,line=1, col=col[1], ...) par(new=T) plot(x,yleft,ylab=, axes=F ,xlab=xlab, pch=pch[2],col=col[2], ...) box() axis(2,pretty(range(yleft,na.rm=T),10),col=col[2]) axis(1,pretty(range(x,na.rm=T),10)) if(yylab[2]==) mtext(deparse(substitute(yleft)),side=2,line=2, col=col[2], ...) else mtext(yylab[2],side=2,line=2, col=col[2], ...) if (linky) lines(x,yleft,col=col[2], lty=2, ...) if (smooth!=0) lines(supsmu(x,yleft,span=smooth),col=col[2], lty=2, lwd=lwds, ...) } Morten -- Morten Sickel Norwegian Radiation Protection Authority http://www.nrpa.no __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help Cheers Petr Pikal [EMAIL PROTECTED] [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Looking for GUI
Hello, There are no GUIs for R available yet, but a few are in preparation: PMG, ObveRsive, TexMacs, (and SciViews, but only under Windows). Keep an eye on http://www.r-project.org/GUI for new items, but I am afraid you wil not find what you are looking for very soon. Best, Philippe Grosjean ...](({°...°}))... ) ) ) ) ) ( ( ( ( ( Dr. Philippe Grosjean ) ) ) ) ) ( ( ( ( ( LOV, UMR 7093 ) ) ) ) ) Station Zoologique ( ( ( ( ( Observatoire Océanologique ) ) ) ) ) BP 28 ( ( ( ( ( 06234 Villefranche sur mer cedex ) ) ) ) ) France ( ( ( ( ( ) ) ) ) ) tel: +33.4.93.76.38.18, fax: +33.4.93.76.38.34 ( ( ( ( ( ) ) ) ) ) e-mail: [EMAIL PROTECTED] ( ( ( ( ( SciViews project coordinator (http://www.sciviews.org) ) ) ) ) ) ... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ulrich Pedri Sent: jeudi 13 mars 2003 11:44 To: [EMAIL PROTECTED] Subject: [R] Looking for GUI Hi List, i am locking for a GUI for R. I have a Debian Woody 3.0 and running R 1.5.1. In office i am using SPSS 9.0 for several years now after Systat for short time and now i would use a statistic software under Linux at home. It seems that R could be that what i am looking for, but i have problems to understand how it works or better explained i would prefer using a good grafic interface. Wich one could i try ?? thank you ULI __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] automated legend for points.geodata
Hi R-users, I have to produce numerous plots using points.geodata function from geoR package. The function however, doesn't have an option to include the legend to the plot (to see the actual values of the data) Is there an automative way to include legend to the plot using points.geodata? I think there might be a way using pch, cex.max, and cex.min primitives and produce the legend independently. But due to the amount of plots I need to produce it is not what I am looking for. Thanks in advance, Rado Bonk -- Radoslav Bonk M.S. Dept. of Physical Geography and Geoecology Faculty of Sciences, Comenius University Mlynska Dolina 842 15, Bratislava, SLOVAKIA tel: +421 905 968 127 e-mail: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] xgobi?
As far as I understood from the documentation of xgobi. The package is intended to plot data in 3D (and more). While xgobi is still available, it is no longer receiving much of its authors' attention. Its successor ggobi (www.ggobi.org), on the other hand, is growing all the time. While xgobi can be launched from R, that is the extent of its relationship to S or R; no live connection between the two processes is maintained. ggobi, on the other hand, is embedded in R and has an API which is expressed in the Rggobi package. The curious are welcome to direct further questions about ggobi and Rggobi to [EMAIL PROTECTED] Debby __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] X11 connection error in web cgi mode only
Dear all, I am trying to create a web interface using Perl-CGI to call R plots and to display them. The following codes works perfectly fine when I copy and paste into the console directly or if I save it into script.file and then R --no-save script.file producing the graphs. jpeg(graph.jpeg, width=400, height=400) plot(rnorm(100)) dev.off() Now, I put the line system(R --no-save script.file log_file) from inside my cgi and then process it from client side, I get the following error message: Error in X11(paste(jpeg::, quality, :, filename, sep = ), width, : unable to start device JPEG In addition: Warning message: unable to open connection to X11 display`' Execution halted Why do I get this error and how can I fix it? Many thanks in advance. Regards, Adai. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Season Determination
Hi R-Community, I have an historical time series of power prices and would like to determine the daily and yearly seasonal component for forecast purposes. Unfortunately the functions decompose and stl do not provide an always identical repeating seasonal pattern which could be continued in the future. Why and is there a possibility to adjust a periodical function like s(t) = a1 sin(f1 t) + b1 cos(f1 t) + a2 sin(f2 t) + b2 cos(f2 t) + ... to a time series, if necessary with given frequencies fi. Much thanks in advance, Hagen Schmoeller -- Dipl.-Ing. Hagen K. Schmöller Institut für Elektrische Anlagen und Energiewirtschaft, RWTH Aachen Schinkelstraße 6, D-52056 Aachen, Germany Tel.: +49 (0)241 80-96734 Fax : +49 (0)241 80-92197 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] how to use R in delphi or vb ?
On Mon, 17 Mar 2003 16:01:39 +0900, you wrote: Dear Sirs, I am a beginner of R . Please teach me. Do someone teach me how to use R within 'delphi ' or Visual Basic? Someone else gave the link to the COM interface for calling R from those languages. If you want to write numerical code in Delphi and call it from R, you should create a DLL, exporting the function(s)er using the cdecl calling convention. If your routine doesn't need to allocate memory which will be returned to R, that's it. If you want to create strings or vectors or more complicated structures and return them, you need to call internal R functions. Mark Bravington has put together some sample code for Delphi, which I've promised to put up on a web page somewhere; I haven't done that yet though. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] RMySQL Install Problem
Hi, Could you tell us what version of MySQL you're running? -- David Fred Gerson wrote: Hey all, I asked my server administrator to install the RMySQL package for me however he was unable to and received the below errors. I searched the archives for some of the words in the error mesage but found no answers. Does anyone have any ideas what might be going wrong? This is R 1.6.2 on a linux box. Thanks, Fred install.packages(RMySQL) trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 100850 bytes opened URL .. .. .. .. .. .. .. .. .. downloaded 98Kb trying URL `http://cran.r-project.org/src/contrib/RMySQL_0.5-0.tar.gz' Content type `application/x-tar' length 390241 bytes opened URL .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . downloaded 381Kb * Installing *source* package 'RMySQL' ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for mysql_init in -lmysqlclient... yes checking for mysql.h... no checking for /usr/local/include/mysql/mysql.h... no checking for /usr/include/mysql/mysql.h... yes updating cache ./config.cache creating ./config.status creating src/Makevars ** libs gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c: In function `RS_MySQL_newConnection': RS-MySQL.c:203: `MYSQL_OPT_LOCAL_INFILE' undeclared (first use in this function) RS-MySQL.c:203: (Each undeclared identifier is reported only once RS-MySQL.c:203: for each function it appears in.) make: *** [RS-MySQL.o] Error 1 ERROR: compilation failed for package 'RMySQL' Delete downloaded files (y/N)? y Warning message: Installation of package RMySQL had non-zero exit status in: install.packages(RMySQL) q() __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- David A. James Statistics Research, Room 2C-253 Bell Labs, Lucent Technologies Murray Hill, NJ 09794-0636 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] RMySQL Install Problem
Hey David, Sorry about that, the server runs MySQL 3.2.39. Thanks a lot, Fred On Mon, 17 Mar 2003, David James wrote: Hi, Could you tell us what version of MySQL you're running? -- David Fred Gerson wrote: Hey all, I asked my server administrator to install the RMySQL package for me however he was unable to and received the below errors. I searched the archives for some of the words in the error mesage but found no answers. Does anyone have any ideas what might be going wrong? This is R 1.6.2 on a linux box. Thanks, Fred install.packages(RMySQL) trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 100850 bytes opened URL .. .. .. .. .. .. .. .. .. downloaded 98Kb trying URL `http://cran.r-project.org/src/contrib/RMySQL_0.5-0.tar.gz' Content type `application/x-tar' length 390241 bytes opened URL .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . downloaded 381Kb * Installing *source* package 'RMySQL' ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for mysql_init in -lmysqlclient... yes checking for mysql.h... no checking for /usr/local/include/mysql/mysql.h... no checking for /usr/include/mysql/mysql.h... yes updating cache ./config.cache creating ./config.status creating src/Makevars ** libs gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c: In function `RS_MySQL_newConnection': RS-MySQL.c:203: `MYSQL_OPT_LOCAL_INFILE' undeclared (first use in this function) RS-MySQL.c:203: (Each undeclared identifier is reported only once RS-MySQL.c:203: for each function it appears in.) make: *** [RS-MySQL.o] Error 1 ERROR: compilation failed for package 'RMySQL' Delete downloaded files (y/N)? y Warning message: Installation of package RMySQL had non-zero exit status in: install.packages(RMySQL) q() __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- David A. James Statistics Research, Room 2C-253 Bell Labs, Lucent Technologies Murray Hill, NJ 09794-0636 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Filled box on graph
Dear John See ?polygon. I hope that this helps, John At 10:20 AM 3/17/2003 -0400, you wrote: Hello All, I need to indicate a range on a plot. It would be best as a filled rectangular region. Do functions exist to draw filled boxes on a plot? Thanks, John. -- -- Dr. John Janmaat Department of Economics, Acadia University, Wolfville, NS, B4P 2R6 E-mail: [EMAIL PROTECTED]Web: http://ace.acadiau.ca/~jjanmaat Tel: 902-585-1461 Fax: 902-585-1070 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help - John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: [EMAIL PROTECTED] phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox - __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Filled box on graph
All responders, Polygon works great, thanks. John. John Fox wrote: Dear John See ?polygon. I hope that this helps, John At 10:20 AM 3/17/2003 -0400, you wrote: Hello All, I need to indicate a range on a plot. It would be best as a filled rectangular region. Do functions exist to draw filled boxes on a plot? Thanks, John. -- -- Dr. John Janmaat Department of Economics, Acadia University, Wolfville, NS, B4P 2R6 E-mail: [EMAIL PROTECTED]Web: http://ace.acadiau.ca/~jjanmaat Tel: 902-585-1461 Fax: 902-585-1070 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help - John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: [EMAIL PROTECTED] phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox - -- -- Dr. John Janmaat Department of Economics, Acadia University, Wolfville, NS, B4P 2R6 E-mail: [EMAIL PROTECTED]Web: http://ace.acadiau.ca/~jjanmaat Tel: 902-585-1461 Fax: 902-585-1070 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] RMySQL Install Problem
Fred Gerson wrote: Hey David, Sorry about that, the server runs MySQL 3.2.39. Probably you mean 3.23.39? You need to change line 197 in the file RMySQL/src/RS-MySQL.c from #if defined(MYSQL_VERSION_ID) MYSQL_VERSION_ID 32339 to #if defined(MYSQL_VERSION_ID) MYSQL_VERSION_ID 32348 -- David Thanks a lot, Fred On Mon, 17 Mar 2003, David James wrote: Hi, Could you tell us what version of MySQL you're running? -- David Fred Gerson wrote: Hey all, I asked my server administrator to install the RMySQL package for me however he was unable to and received the below errors. I searched the archives for some of the words in the error mesage but found no answers. Does anyone have any ideas what might be going wrong? This is R 1.6.2 on a linux box. Thanks, Fred install.packages(RMySQL) trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 100850 bytes opened URL .. .. .. .. .. .. .. .. .. downloaded 98Kb trying URL `http://cran.r-project.org/src/contrib/RMySQL_0.5-0.tar.gz' Content type `application/x-tar' length 390241 bytes opened URL .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . downloaded 381Kb * Installing *source* package 'RMySQL' ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for mysql_init in -lmysqlclient... yes checking for mysql.h... no checking for /usr/local/include/mysql/mysql.h... no checking for /usr/include/mysql/mysql.h... yes updating cache ./config.cache creating ./config.status creating src/Makevars ** libs gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o gcc -I/usr/local/lib/R/include -I/usr/include/mysql -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -g -O2 -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c: In function `RS_MySQL_newConnection': RS-MySQL.c:203: `MYSQL_OPT_LOCAL_INFILE' undeclared (first use in this function) RS-MySQL.c:203: (Each undeclared identifier is reported only once RS-MySQL.c:203: for each function it appears in.) make: *** [RS-MySQL.o] Error 1 ERROR: compilation failed for package 'RMySQL' Delete downloaded files (y/N)? y Warning message: Installation of package RMySQL had non-zero exit status in: install.packages(RMySQL) q() __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- David A. James Statistics Research, Room 2C-253 Bell Labs, Lucent Technologies Murray Hill, NJ 09794-0636 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- David A. James Statistics Research, Room 2C-253Phone: (908) 582-3082 Bell Labs, Lucent Technologies Fax:(908) 582-3340 Murray Hill, NJ 09794-0636 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] glm -gamma errors
Dear list, I am looking for a way to fix the scale parameter when fitting a generalized linear model with gamma errors and log link. Is there something like SCALE such as in GLIM? As always thanks a lot. Peter __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] r-square in LME?
Dear Members of the R-Help-List I analysed data with LME in R. Is there a measure for LME (likelihood estimated) statistics which has an analogous meaning to the coefficient of determination (r-square) estimated by least-square procedure? Best wishes Daniel Bloch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Trying to build R-1.6.2 under sparc-sun-solaris2.9.
This is a follow-up to a message I posted yesterday concerning building R-1.6.2. After a deafening silence regarding that first message I decided to be fool-hardy and just comment out the line that seemed to be giving trouble in the file /usr/include/sys/stream.h. This worked for a while, but soon another error resulted: ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== gcc -I. -I../../../src/include -I../../../src/include -DHAVE_CONFIG_H -fPIC -g -O2 -c Rsock.c -o Rsock.lo Rsock.c: In function `R_SockConnect': Rsock.c:378: `len' undeclared (first use in this function) Rsock.c:378: (Each undeclared identifier is reported only once Rsock.c:378: for each function it appears in.) *** Error code 1 make: Fatal error: Command failed for target `Rsock.lo' Current working directory /tmp/Rtmp/R-1.6.2/src/modules/internet *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src/modules/internet *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src/modules *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src *** Error code 1 make: Fatal error: Command failed for target `R' ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== Now this (Rsock.c) is actually dinky-di R code, but of course the error has probably been induced by the previous error involving ``stream.h'' and possibly aggravated by my commenting out the offending line in stream.h. Has anyone out there a clue as to what is going on, and what I might do to fix it? Everlastingly grateful for any suggestions. cheers, Rolf Turner [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Error in file(file, r)
Hello, I am a new user of R, and I am not able to read/scan external files. I am working in a Linux environment. I have read through the R FAQ and documents and have not been successful using the recommendations. Below are several scripts I've used and the error messages. . I've cc'd Brandon Whitcher because it was recommended in another FAQ. I read that this is a bug that occurs on Windows. Is there is a patch/fix that I can use? I'd appreciate any help with this problem. Thnx, Barbara Chisolm Test2 - scan(C:\\bac\\TestData2) Error in file(file, r) : cannot open file `C:\bac\TestData2 ' test1-read.table('J:/bac/R/TestDataWord.txt') Error in file(file, r) : cannot open file `J:/bac/R/TestDataWord.txt' setwd(J:/bac/R/) Error in setwd(dir) : cannot change working directory __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Trying to build R-1.6.2 under sparc-sun-solaris2.9.
Rolf Turner [EMAIL PROTECTED] writes: This is a follow-up to a message I posted yesterday concerning building R-1.6.2. After a deafening silence regarding that first message I decided to be fool-hardy and just comment out the line that seemed to be giving trouble in the file /usr/include/sys/stream.h. This worked for a while, but soon another error resulted: ... Has anyone out there a clue as to what is going on, and what I might do to fix it? [The R-core team is in meetings in Vienna, so the response rate is not going to be great this week] It's certainly doable: version _ platform sparc-sun-solaris2.9 arch sparc os solaris2.9 system sparc, solaris2.9 status major1 minor6.2 year 2003 month01 day 10 language R It's been a while since I built that, but that's pretty much a vanilla system with the Solaris 9 freeware installed. Your configure output suggests that you hav a system installation problem and some include files has gone AWOL. Check the config.log for hints about what might be missing. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] X11 connection error in web cgi mode only
I believe you get this error because the jpeg and png libraries require the X11 device to be open in order to generate the plot. I'll guess that if you're doing CGI then the X11 device is not available. You can try using the `bitmap' device if you want jpeg or png. This converts to jpeg/png from postscript. -roger ___ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Mon, 17 Mar 2003, Adaikalavan Ramasamy wrote: Dear all, I am trying to create a web interface using Perl-CGI to call R plots and to display them. The following codes works perfectly fine when I copy and paste into the console directly or if I save it into script.file and then R --no-save script.file producing the graphs. jpeg(graph.jpeg, width=400, height=400) plot(rnorm(100)) dev.off() Now, I put the line system(R --no-save script.file log_file) from inside my cgi and then process it from client side, I get the following error message: Error in X11(paste(jpeg::, quality, :, filename, sep = ), width, : unable to start device JPEG In addition: Warning message: unable to open connection to X11 display`' Execution halted Why do I get this error and how can I fix it? Many thanks in advance. Regards, Adai. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Error in making R-1.6.2.
My experience (which isn't worth much) is that the problem isn't with the header file itself but that it depends on some *other* header file that isn't getting included. This other file may have macro definitions, etc. which, if not included, could cause a parse error. -roger ___ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Sun, 16 Mar 2003, Rolf Turner wrote: I have just tried to update the version of R on our system, and when I did ``make'', I got the following error message: ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== gcc -I. -I../../src/include -I../../src/include -DHAVE_CONFIG_H -g -O2 -c platform.c -o platform.o In file included from /usr/include/netinet/in.h:41, from /usr/include/netdb.h:96, from platform.c:1079: /usr/include/sys/stream.h:307: parse error before projid_t *** Error code 1 ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== I looked at the file /usr/include/sys/stream.h and found the offending line. It is right at the end of a ``typedef'' construction. (Whatever that is; I don't speak C.) I've included the beginning of this construction in what I've displayed below, so that you can see ``where things are coming from''. (???) ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== typedef struct datab { --- Line 277 (my annotation) frtn_t *db_frtnp; unsigned char *db_base; unsigned char *db_lim; unsigned char db_ref; . . . fthdr_t *db_fthdr; ftflw_t ***db_ftflw; uid_t db_uid; /* Effective user id */ /* project ID - EXPERIMENTAL - may change in future release */ projid_tdb_projid; --- Line 307 (my annotation) } dblk_t; ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== I have no idea why there should be a ``parse error'' at or before line 307. Can anyone enlighten me and suggest what I can do about it? The information about the current version is: platform sparc-sun-solaris2.9 arch sparc os solaris2.9 system sparc, solaris2.9 status major1 minor5.1 year 2002 month06 day 17 language R (As you can see I haven't upgraded for a while. Sigh. I've been afraid of running into the sort of trouble that I've just run into.) I'll be grateful for any advice, but I would humbly request that you express it in terms as simple and explicit as you can. As I said, I don't speak C, and I'm very much fumbling about in the dark here. cheers, Rolf Turner [EMAIL PROTECTED] P. S. There are a bunch of WARNING messages in config.log, which may be relevant as some of them refer to ``netinet'' and ``netdb: ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== configure:8871: WARNING: you cannot build info versions of the R manuals configure:12127: WARNING: arpa/inet.h: present but cannot be compiled configure:12129: WARNING: arpa/inet.h: check for missing prerequisite headers? configure:12131: WARNING: arpa/inet.h: proceeding with the preprocessor's result configure:12127: WARNING: netdb.h: present but cannot be compiled configure:12129: WARNING: netdb.h: check for missing prerequisite headers? configure:12131: WARNING: netdb.h: proceeding with the preprocessor's result configure:12127: WARNING: netinet/in.h: present but cannot be compiled configure:12129: WARNING: netinet/in.h: check for missing prerequisite headers? configure:12131: WARNING: netinet/in.h: proceeding with the preprocessor's resul t configure:12127: WARNING: sys/socket.h: present but cannot be compiled configure:12129: WARNING: sys/socket.h: check for missing prerequisite headers? configure:12131: WARNING: sys/socket.h: proceeding with the preprocessor's resul t configure:12709: WARNING: could not determine type of socket length configure:26299: WARNING: could not determine type of socket length configure:26327: WARNING: you cannot build info versions of the R manuals ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Trying to build R-1.6.2 under sparc-sun-solaris2.9.
Is it possible that something has changed in your system setup since the last install? The problem below seems to be that SOCKLEN_T is not defined, which is why (I think) you get the error Rsock.c:378: `len' undeclared (first use in this function) If I remember correctly, your configure gave warnings about not being able to determine the length of a socket, which is defined in some header files on your system somewhere (sorry, I don't use Solaris). I'd check to make sure these are being included or that their in the place R thinks they are. -roger ___ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Mon, 17 Mar 2003, Rolf Turner wrote: This is a follow-up to a message I posted yesterday concerning building R-1.6.2. After a deafening silence regarding that first message I decided to be fool-hardy and just comment out the line that seemed to be giving trouble in the file /usr/include/sys/stream.h. This worked for a while, but soon another error resulted: ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== gcc -I. -I../../../src/include -I../../../src/include -DHAVE_CONFIG_H -fPIC -g -O2 -c Rsock.c -o Rsock.lo Rsock.c: In function `R_SockConnect': Rsock.c:378: `len' undeclared (first use in this function) Rsock.c:378: (Each undeclared identifier is reported only once Rsock.c:378: for each function it appears in.) *** Error code 1 make: Fatal error: Command failed for target `Rsock.lo' Current working directory /tmp/Rtmp/R-1.6.2/src/modules/internet *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src/modules/internet *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src/modules *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /tmp/Rtmp/R-1.6.2/src *** Error code 1 make: Fatal error: Command failed for target `R' ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== Now this (Rsock.c) is actually dinky-di R code, but of course the error has probably been induced by the previous error involving ``stream.h'' and possibly aggravated by my commenting out the offending line in stream.h. Has anyone out there a clue as to what is going on, and what I might do to fix it? Everlastingly grateful for any suggestions. cheers, Rolf Turner [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Error in file(file, r)
You say you are using the Linux environment. Hence you files are not being found. You are using the path system of a Windows environment. If your bac directory is in your home directory, try the following: Test2 - scan(~/bac/TestData2) HTH, Partha. Chisolm, Barbara [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/17/2003 11:52 AM To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject:[R] Error in file(file, r) Hello, I am a new user of R, and I am not able to read/scan external files. I am working in a Linux environment. I have read through the R FAQ and documents and have not been successful using the recommendations. Below are several scripts I've used and the error messages. . I've cc'd Brandon Whitcher because it was recommended in another FAQ. I read that this is a bug that occurs on Windows. Is there is a patch/fix that I can use? I'd appreciate any help with this problem. Thnx, Barbara Chisolm Test2 - scan(C:\\bac\\TestData2) Error in file(file, r) : cannot open file `C:\bac\TestData2 ' test1-read.table('J:/bac/R/TestDataWord.txt') Error in file(file, r) : cannot open file `J:/bac/R/TestDataWord.txt' setwd(J:/bac/R/) Error in setwd(dir) : cannot change working directory __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] xgobi?
Are there any plans to implement XGvis features in GGobi? I find the multidimensional scaling in XGvis quite interesting. ;-) On Mon, 17 Mar 2003, Deborah Swayne wrote: Date: Mon, 17 Mar 2003 08:28:52 -0500 From: Deborah Swayne [EMAIL PROTECTED] To: Miha STAUT [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] xgobi? As far as I understood from the documentation of xgobi. The package is intended to plot data in 3D (and more). While xgobi is still available, it is no longer receiving much of its authors' attention. Its successor ggobi (www.ggobi.org), on the other hand, is growing all the time. While xgobi can be launched from R, that is the extent of its relationship to S or R; no live connection between the two processes is maintained. ggobi, on the other hand, is embedded in R and has an API which is expressed in the Rggobi package. The curious are welcome to direct further questions about ggobi and Rggobi to [EMAIL PROTECTED] Debby __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- Cheers, Kevin -- /* Time is the greatest teacher, unfortunately it kills its students */ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Using .Call function to do matrix calculation
Hello, Because of high dimensionality of matrix, I can not use R matrix calculation operator to do matrix multiplication. My interest is the diagonal elements of J*J matrix( which can be got by multiplying matrix a(J*K) and b(K*J)), where J is too big to allocate enough memory for it. In order to get those diagonals, I tried .Call function to do that. Here is c program for .Call. #include R.h #include Rinternals.h SEXP var(SEXP a,SEXP b){ int i,J=nrows(a),j,K=nrows(b),k; SEXP varbeta; PROTECT(varbeta=allocVector(REALSXP,J)); for(j=0;jJ;j++){ for(k=0;kJ;k++){ if(j==k){ for(i=0;iK;i++) REAL(varbeta)[j]+=REAL(a)[j+i*J]*REAL(b)[i+k*K];} } } UNPROTECT(1); return (varbeta); } This function did not work at all. The warning messages is the segmentation fault. Could some expert help me out? Thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] scoping rules; summary
Hi everyone thanks for the replies. The issue was NOT a font problem; I deliberately chose ll1 and l11 as examples of easily confused variable names (evidently these were too easily confused ;-). The code snippet was written as intended, and increment() contained a deliberate, highlighted, bug. I was asking for guidance on avoiding/finding this sort of coding error. That was why I wrote #bug here in the original code, and why the function was called increment()---because the function should have incremented x by adding a variable whose value was 1 (of course, the function as written, contrary to the desired functionality of increment(), added a variable whose value was 2). I guess I wasn't explicit enough here. Sorry. The fundamental problem was, how to tell that a variable being used in a function is not local? One answer (thanks Patrick!): conflicts() shows masked objects on the search path, which is not quite what I need: I want some way to list all non-local variables that increment() uses in its body. [The original variable names referred to genetic bandsharing data for possums, eg coates.female.pouchyoung.allbands.method5 and huapai.young.male.sibling.relatedness.method3 and huapai.old.female.nonsibling.relatedness.justdarkbands.method1 ad nauseum...hence the need for shorter example variable names!] ll1 - 2 #sic increment - function(x) { l11 - 1#sic return(x+ll1) #sic; deliberate bug here (sic) } -- Robin Hankin, Lecturer, School of Geography and Environmental Science Tamaki Campus Private Bag 92019 Auckland New Zealand [EMAIL PROTECTED] tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Using .Call function to do matrix calculation
Dear Deli Wang, Perhaps this isn't what you're looking for, but it occurs to me that you probably can do this problem without compiled code as sapply(1:nrow(a), function(i) sum(a[i,] * b[,i])). This doesn't use much memory, and though it may execute slowly, you may also get the answer before you debug your C code. I hope that this helps, John At 01:42 PM 3/17/2003 -0600, Deli Wang wrote: Hello, Because of high dimensionality of matrix, I can not use R matrix calculation operator to do matrix multiplication. My interest is the diagonal elements of J*J matrix( which can be got by multiplying matrix a(J*K) and b(K*J)), where J is too big to allocate enough memory for it. In order to get those diagonals, I tried .Call function to do that. Here is c program for .Call. #include R.h #include Rinternals.h SEXP var(SEXP a,SEXP b){ int i,J=nrows(a),j,K=nrows(b),k; SEXP varbeta; PROTECT(varbeta=allocVector(REALSXP,J)); for(j=0;jJ;j++){ for(k=0;kJ;k++){ if(j==k){ for(i=0;iK;i++) REAL(varbeta)[j]+=REAL(a)[j+i*J]*REAL(b)[i+k*K];} } } UNPROTECT(1); return (varbeta); } This function did not work at all. The warning messages is the segmentation fault. Could some expert help me out? Thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help John Fox Department of Sociology McMaster University email: [EMAIL PROTECTED] web: http://www.socsci.mcmaster.ca/jfox __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] postscript and ps.option metrics
Good Afternoon All, I am working on a project to generate a particular celeration graph that requires a very specific height and width in the format of the postscript output. I have attempted to specify my height and width parameters in inches as I found in the R help documentation, but this produces a graph much smaller than what it should if the standard metric is indeed inches. Since inches do not work, I've tried to eyeball the metric by printing out different iterations of the height and width parameters and overlaying a copy of the graph I need on it. This is very time consuming (which I don't mind), inefficient (which I do mind), and tedious (which I do mind) as the width axis (X axis in landscape format) doesn't seem to be moving as the parameter decreases in iterations. If someone has a few minutes, could you review the code snippet below and provide any suggestions about possible revisions/additions to this? I've looked at it so long I can't tell what might be glaringly wrong or missing. Many Thanks, Patrick McLeod University of North Texas Denton, TX. P.S. The specific axis measurements (in inches) should be: height=5.4, width=8.1 in a landscape format. # TODO: #win.graph(width=8.6,height=11.5) postscript(C:/Data/.ps, width = 11.6, height = 7.5, horizontal = TRUE, onefile = TRUE, paper = letter, family = ComputerModern) # Import Sample Data: Movies IMDB) movies - read.table('x', header=T, row.names=NULL) attach(movies) # cases - read.table('x', header=T, row.names=NULL) # attach(cases) # Set up the chart yticks - c(1,2,3,4,5,6,7,8,9, 10,20,30,40,50,60,70,80,90, 100,200,300,400,500,600,700,800,900, 1000,2000,3000,4000,5000,6000,7000,8000,9000, 1,2,3,4,5,6,7,8,9, 10,20,30,40,50,60,70,80,90,100) myticks - c(1,10,100,1000,1,10,100) mylabs - c(1,10,100,1,000,10,000,100,000, 1,000,000) mnyticks - c(5,50,500,5000,5,50) mnylabs - c(5,50,500,5,000,50,000,500,000) xticks - c(1:100) #mxticks - c(0,10,20,30,40,50,60,70,80,90,100) periods - c(1900,1905,1910,1915,1920,1925,1930,1935,1940,1945,1950,1955,1960,1965,1970,1975,1980,1985,1990,1995,2000) mxticks - c(1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000) mnxticks - c(1905,1915,1925,1935,1945,1955,1965,1975,1985,1995) mxlabs - c(0,10,20,30,40,50,60,70,80,90,100) plot(Year,Movies,ylim=c(1,100),xlim=c(1902,2002),log='y',type='o',axes=F) axis(side=2, at=myticks, las=2, labels=mylabs, pos=1900, tck=-0.02) axis(side=2, at=myticks, pos=1900, tck=.95, labels=F) axis(side=2, at=yticks, labels=F, pos=1900, tck=0.01) axis(side=2, at=yticks, labels=F, pos=1900, tck=0.93) axis(side=2, at=mnyticks, las=2, labels=mnylabs, pos=1900, tck=-0.015, cex=.5) axis(side=2, at=mnyticks, las=2, labels=F, pos=1900, tck=0.93, cex=.5) axis(side=1, at=mxticks, pos=1, labels=mxlabs, tck=-0.02) axis(side=1, at=c(1900:2000), pos=1, labels=F,tck=-0.01) axis(side=1, at=mnxticks,pos=1, tck=.01, labels=F) axis(side=1, at=periods, pos=1, tck=.93, labels=F) axis(side=3, at=mxticks, pos=100) axis(side=4,pos=2000,labels=F,tck=0) dev.off() __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] search engine dose not work for Morzilla
Hello, I am running R1.6.2 on Redhat8.0. I use Morzilla to display the html file. However,the search engine does not work. eg. I type plot and press search, it does not return the result but show the same page. Any idea? Thanks! Y.Fan __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] help with likelihood contour plot
Can some kind person point out my error here? I'm trying to set up a grid for a countour plot of a likelihood function. u - rnorm(20,9.5,2.5) # sample of size 20 from N(9.5,2.5^2) loglik - function(th1,th2) { + n - length(u) + -(n/2)*log(2*pi*th2^2)-0.5*sum((u-th1)^2/th2^2) + } x - seq(4.5,14.5,len=50) y - seq(0.5,6,len=50) f - outer(x, y, loglik(x,y)) Error in match.fun(FUN) : not function, character, or symbol: loglik(x, y) In addition: Warning message: longer object length is not a multiple of shorter object length in: u - th1 loglik(9,2) [1] -44.56294 is.function(loglik) [1] TRUE Thanks, Murray -- Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html Department of Statistics, University of Waikato, Hamilton, New Zealand Email: [EMAIL PROTECTED]Fax 7 838 4155 Phone +64 7 838 4773 wk+64 7 849 6486 homeMobile 021 1395 862 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] search engine dose not work for Morzilla
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yiping Fan Sent: Monday, March 17, 2003 4:07 PM To: R_Help (E-mail) Subject: [R] search engine dose not work for Morzilla Hello, I am running R1.6.2 on Redhat8.0. I use Morzilla to display the html file. However,the search engine does not work. eg. I type plot and press search, it does not return the result but show the same page. Any idea? Thanks! Y.Fan See my prior post on this here: http://maths.newcastle.edu.au/~rking/R/help/02b/4228.html Also be sure that under Prefences (Advanced and Scripts/Plugins) that BOTH Java and JavaScript are enabled. Regards, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] help with likelihood contour plot
Murray Jorgensen wrote: Can some kind person point out my error here? I'm trying to set up a grid for a countour plot of a likelihood function. u - rnorm(20,9.5,2.5) # sample of size 20 from N(9.5,2.5^2) loglik - function(th1,th2) { + n - length(u) + -(n/2)*log(2*pi*th2^2)-0.5*sum((u-th1)^2/th2^2) + } x - seq(4.5,14.5,len=50) y - seq(0.5,6,len=50) f - outer(x, y, loglik(x,y)) Error in match.fun(FUN) : not function, character, or symbol: loglik(x, y) In addition: Warning message: longer object length is not a multiple of shorter object length in: u - th1 loglik(9,2) [1] -44.56294 is.function(loglik) [1] TRUE Thanks, Murray Murray, From ?outer: Details: `FUN' must be a function (or the name of it) which expects at least two arguments and which operates elementwise on arrays. Thus, use loglik and not loglik(x,y), as in: outer(x,y,loglik) Regards, Sundar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] help with likelihood contour plot
Be careful, I don't think your loglik function is vectorized correctly. In particular, it only works for single values of th1 and th2. If th1 or th2 are vectors, you will get a warning and the wrong answer. The problem is the subtraction u - th1, because u is already vector. outer() expects that the function you pass in is vectorized and will work elementwise on arrays, not just single values. -roger ___ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Mon, 17 Mar 2003, Sundar Dorai-Raj wrote: Murray Jorgensen wrote: Can some kind person point out my error here? I'm trying to set up a grid for a countour plot of a likelihood function. u - rnorm(20,9.5,2.5) # sample of size 20 from N(9.5,2.5^2) loglik - function(th1,th2) { + n - length(u) + -(n/2)*log(2*pi*th2^2)-0.5*sum((u-th1)^2/th2^2) + } x - seq(4.5,14.5,len=50) y - seq(0.5,6,len=50) f - outer(x, y, loglik(x,y)) Error in match.fun(FUN) : not function, character, or symbol: loglik(x, y) In addition: Warning message: longer object length is not a multiple of shorter object length in: u - th1 loglik(9,2) [1] -44.56294 is.function(loglik) [1] TRUE Thanks, Murray Murray, From ?outer: Details: `FUN' must be a function (or the name of it) which expects at least two arguments and which operates elementwise on arrays. Thus, use loglik and not loglik(x,y), as in: outer(x,y,loglik) Regards, Sundar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Building hdf5 for ms-windows
I am trying to build hdf5 for ms-windows. I downloaded the hdf5_1.4.7.tar.gz, gunzipped it and got a tar file. I extracted everything into a directory tree called hdf5. I also found a Makevars.win and libhdf5.def in the R help archives from March 2002. I put those two in hdf5 as well. I issued the command Rcmd build --binary hdf5 but got this message complaining it can't find hdf5.h along with subsequent errors. making DLL ... making hdf5.d from hdf5.c hdf5.c:24:18: hdf5.h: No such file or directory make[2]: *** [hdf5.d] Error 1 make[1]: *** [src/hdf5.dll] Error 2 make: *** [pkg-hdf5] Error 2 make: Leaving directory `/cygdrive/c/PROGRA~1/R/rw1062/src/gnuwin32' *** Installation of hdf5 failed *** What should I do? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Building hdf5 for ms-windows
On Mon, Mar 17, 2003 at 06:48:48PM -0800, Gabor Grothendieck wrote: I am trying to build hdf5 for ms-windows. I downloaded the hdf5_1.4.7.tar.gz, gunzipped it and got a tar file. I extracted everything into a directory tree called hdf5. I also found a Makevars.win and libhdf5.def in the R help archives from March 2002. I put those two in hdf5 as well. I issued the command Rcmd build --binary hdf5 but got this message complaining it can't find hdf5.h along with subsequent errors. making DLL ... making hdf5.d from hdf5.c hdf5.c:24:18: hdf5.h: No such file or directory make[2]: *** [hdf5.d] Error 1 make[1]: *** [src/hdf5.dll] Error 2 make: *** [pkg-hdf5] Error 2 make: Leaving directory `/cygdrive/c/PROGRA~1/R/rw1062/src/gnuwin32' *** Installation of hdf5 failed *** What should I do? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help If your aim is only to get a working version of a package to have hdf5 functionalities, you can try the package rhdf5 at www.bioconductor.org (there should be a MSWindows build). Hopin' it helps, L. -- -- currently at the National Yang-Ming University in Taipei, Taiwan -- Laurent Gautier CBS, Building 208, DTU PhD. StudentDK-2800 Lyngby,Denmark tel: +45 45 25 24 89http://www.cbs.dtu.dk/laurent __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Simulation
Hallo all users of R. I wish to simulate a simple linear regression, y=a+bx+e, (n=40, say), where x is N(0,1) and where e is N(0,1), with probability 0.9, and e is 3*(chisq(40,1)-1), say, with probability 0.1. For e: would the following work, or is there a better way? p - rbinom(40,1,0.9) e - rnorm(40,0,1)*p + 3*(rchisq(40,1)-1)*(1-p) Thanks for your time. Regards Jacob Jacob L van Wyk Department of Mathematics and Statistics Rand Afrikaans University P O Box 524 Auckland Park 2006 South Africa Tel: +27-11-489-3080 Fax: +27-11-489-2832 __ VRYWARING\ \ Die inhoud en enige aanhegsels van hierdie elektron... [[dropped]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Package installation when $RHOME is not writable (win)
I'm using R in a student lab with machines running win XP. $RHOME is not writable by the students. How do I set this up so that they can install packages? Thanks, Robert. Robert King, Statistics, School of Mathematical Physical Sciences, University of Newcastle, Australia Room V133 ph +61 2 4921 5548 [EMAIL PROTECTED] http://maths.newcastle.edu.au/~rking/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Package installation when $RHOME is not writable (win)
On Tue, Mar 18, 2003 at 05:40:32PM +1100, Robert King wrote: I'm using R in a student lab with machines running win XP. $RHOME is not writable by the students. How do I set this up so that they can install packages? Thanks, Robert. Robert King, Statistics, School of Mathematical Physical Sciences, University of Newcastle, Australia Room V133 ph +61 2 4921 5548 [EMAIL PROTECTED] http://maths.newcastle.edu.au/~rking/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help I am not very familiar with the windows version, but on unices this can be done without any problem. Try '?install.packages' and check the parameter 'lib' (or 'instlib') Hopin' it helps, Laurent -- -- currently at the National Yang-Ming University in Taipei, Taiwan -- Laurent Gautier CBS, Building 208, DTU PhD. StudentDK-2800 Lyngby,Denmark tel: +45 45 25 24 89http://www.cbs.dtu.dk/laurent __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Package installation when $RHOME is not writable (win)
Hi, I think this is covered in R for Windows FAQ in Section 2.11 and 2.12 (http://cran.r-project.org/bin/windows/contrib/rw-FAQ.html) On Tue, 18 Mar 2003, Robert King wrote: Date: Tue, 18 Mar 2003 17:40:32 +1100 (EST) From: Robert King [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] Package installation when $RHOME is not writable (win) I'm using R in a student lab with machines running win XP. $RHOME is not writable by the students. How do I set this up so that they can install packages? Thanks, Robert. Robert King, Statistics, School of Mathematical Physical Sciences, University of Newcastle, Australia Room V133 ph +61 2 4921 5548 [EMAIL PROTECTED] http://maths.newcastle.edu.au/~rking/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- Cheers, Kevin -- /* Time is the greatest teacher, unfortunately it kills its students */ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help