[R] Re: R-help digest, Vol 1 #10 - 6 msgs

=?big5?B?vEKu/Lpz?= liuhz at mail.cptt.com.tw
Mon Dec 9 01:05:03 CET 2002


°_§É§¿§¿
----- Original Message -----
From: <r-help-request at stat.math.ethz.ch>
To: <r-help at stat.math.ethz.ch>
Sent: Sunday, December 08, 2002 7:00 PM
Subject: R-help digest, Vol 1 #10 - 6 msgs


> Send R-help mailing list submissions to
> r-help at stat.math.ethz.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help' to
> r-help-request at stat.math.ethz.ch
>
> You can reach the person managing the list at
> r-help-admin at stat.math.ethz.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-help digest..."
>
>
> Today's Topics:
>
>    1. Re: fortran -> R (=?iso-8859-1?Q?G=F6ran_Brostr=F6m?=)
>    2. Re: R 1.6.1 segmentation fault (David Meyer)
>    3. simplex(boot) problem (George LeCompte)
>    4. bugs in system() handling long character strings?? (Naoki
Takebayashi)
>    5. Re: bugs in system() handling long character strings??
(ripley at stats.ox.ac.uk)
>    6. color of plot axes involving POSIX types (Richard Rowe)
>
> --__--__--
>
> Message: 1
> Date: Sat, 7 Dec 2002 12:28:50 +0100 (CET)
> From: =?iso-8859-1?Q?G=F6ran_Brostr=F6m?= <gb at stat.umu.se>
> To: Christian Schulz <ozric at web.de>
> cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] fortran -> R
>
> On Sat, 7 Dec 2002, Christian Schulz wrote:
>
> > Hi,
> >
> > i'm working with a interesting book from
> > Michael Smithson: "Fuzzy Set Analysis for Behavioral and Social
> > Sciences",1987.
> > with small listenings in Fortran.
> >
> > It's a pitty that i'm more or less understand nothing from Fortran -
> > have anybody an sugestion or perhaps interesting (...incl. Fortran
skills ?)
> > how
> > i can get it in R or Java.
>
> in R: Read "Writing R extensions" especially "...foreign language
> interfaces", and look at ?.Fortran
> >
> > Now anybody a Fortran2Java  translator, it seems that something like
this
> > exist ?
>
> Don't know anything about that.
>
> > The programs are written in Fortran77 for Dec-10 !
>
> Should be ok, if the code doesn't contain Dec extensions to the F77
> standard. But you'll probably notice that at compile time :-)
>
> Göran
>
>
> --__--__--
>
> Message: 2
> Date: Sat, 07 Dec 2002 14:39:00 +0100
> From: David Meyer <david.meyer at ci.tuwien.ac.at>
> Organization: Vienna University of Technology
> To: Per-Anders Wernberg <wernberg at byggmek.lth.se>
> CC: r-help at stat.math.ethz.ch
> Subject: Re: [R] R 1.6.1 segmentation fault
>
> Per-Anders Wernberg wrote:
> >
> > Hi,
> > We have been running R ver 1.4.1 on a redhat linux (7.1)cluster without
> > problem for quit some time.
> > Now, some user wanted me to install version 1.6.1, and it compiled fine,
> > but it crashes with "segmentation fault" when you run it. I used gcc296
> > (default) for compiling, Should I change compiler
>
> yes, definitely.
>
> -d
>
> > or is there some other
> > thing I could do to  avoid this problem.
> >
> > Regards
> > Per-Anders
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
> --
> Mag. David Meyer Wiedner Hauptstrasse 8-10
> Vienna University of Technology A-1040 Vienna/AUSTRIA
>          Department of Tel.: (+431) 58801/10772
> Statistics and Probability Theory mail: david.meyer at ci.tuwien.ac.at
>
>
> --__--__--
>
> Message: 3
> Date: Sat, 07 Dec 2002 10:12:18 -0800
> From: George LeCompte <george at lecompte.org>
> To: R-help at stat.math.ethz.ch
> Subject: [R] simplex(boot) problem
>
> This is a multi-part message in MIME format.
> --------------060007010402070602040701
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Transfer-Encoding: 7bit
>
> The attached test6.r sets up input for simplex from boot package.  It's
> input file is short2A.txt.
>
> Running under R 1.6.1 I get the following error message.
>
> Error in simplex1 (out1$a[1:(n + m1 + m2)], out1$A[, 1:(n + m1 + m2)], :
>           subscript out of bounds
>
> Other calls to simplex seem to work properly
>
> What am I doing wrong?
>
> --------------060007010402070602040701
> Content-Type: text/plain;
>  name="test6.R"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="test6.R"
>
> library(boot)
> filen<-"short2A.txt"
> print(filen)
> read.table(filen,header = TRUE,row.names=1,sep=",")->tab
> print("tab")
> print(tab)
> v<-scan(file=filen,what=list(v="V"),flush=TRUE,sep=",")
> names<-v$v[2:length(v$v)]
> print("names")
> print(names)
> print("f")
> f<-tab[,1]
> print(f)
>
> A1<-t(tab[,2:5])
> e<-rep(0,length(f))
> e[2]<-1
> A1<-rbind(A1,e)
> print("A1")
> print(A1)
> b1<-c(rep(100,4),1)
> print(b1)
> A2<-t(tab[,6:11])
> e<-rep(0,length(f))
> e[5]<-1
> A2<-rbind(A2,e)
> b2<-c(rep(100,6),4)
> print(A2)
> print(b2)
> print("A3")
> e4<-rep(0,length(f))
> e4[4]<-1
> e1<-rep(0,length(f))
> e1[1]<-1
> e3<-rep(0,length(f))
> e3[3]<-1
> A3<-rbind(e4,e1,e3)
> b3<-c(0,0,0)
> print(A3)
> print(b3)
> ss<-simplex(f,A1,b1,A2,b2,A3,b3)
>
> --------------060007010402070602040701
> Content-Type: text/plain;
>  name="short2A.txt"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="short2A.txt"
>
> "X1","X2","X3","X4","X5","X6","X7","X8","X9","X10","X11","X12"
> "y1",210,15,9,0,6,9,10,0,15,0,2
> "Y2",450,33,19,0,12,19,21,0,30,2,6
> "y3",540,40,23,0,15,23,25,0,35,2,8
> "y4",610,45,25,0,16,26,28,0,40,2,8
> "y5",100,10,15,25,5,1,8,30,25,15,6
> "y6",150,3,3,0,11,9,6,0,0,20,10
> "y7",340,12,8,6,26,19,0,0,0,20,25
> "y8",300,5,3,0,16,20,11,0,0,10,8
> "y9",380,8,11,5,10,25,9,2,40,30,10
> "y10",40,5,0,0,2,1,2,0,0,0,0
> "y11",230,12,9,0,11,13,4,0,0,0,10
> "y12",180,0,0,0,0,14,0,6,210,4,2
>
> --------------060007010402070602040701--
>
>
> --__--__--
>
> Message: 4
> Date: Sat, 7 Dec 2002 16:01:04 -0500 (EST)
> From: Naoki Takebayashi <ntakebay at bio.indiana.edu>
> To: r-help at stat.math.ethz.ch
> Subject: [R] bugs in system() handling long character strings??
>
> Hi,
>
> system(cmd, intern=T) seems to have a problem when cmd returns a long
> character string.
>
> For example, if a file (/tmp/long.txt) contains a long string such as:
>
>
1234567890123456789012345678901234567890123456789012345678901234567890123456
78901234567890123456789012345678901234567890
>
> There are 120 characters in this one line.
>
> > junk <- system("cat /tmp/long", TRUE)
> > junk
> [1]
"123456789012345678901234567890123456789012345678901234567890123456789012345
6789012345678901234567890123456789012345678"
> [2] "0"
> > nchar(junk[1])
> [1] 118
>
> So one long line get separated into two parts, and additionally 119-th
> character is missing.
>
> Is this a bug in R or am I missing something?
>
> I tried this on R-1.6.1 on linux/alpha and linux/i386.
>
> Thanks,
> Naoki
>
> Naoki Takebayashi     <ntakebay at bio.indiana.edu>
> --- Dept. of Biology, Box 90338, Duke University, Durham, NC 27708-0338
>
>
> --__--__--
>
> Message: 5
> Date: Sat, 7 Dec 2002 22:50:06 +0000 (GMT)
> From: <ripley at stats.ox.ac.uk>
> To: Naoki Takebayashi <ntakebay at bio.indiana.edu>
> cc: <r-help at stat.math.ethz.ch>
> Subject: Re: [R] bugs in system() handling long character strings??
>
> There is an undocumented limit of 119 characters/line when using
> system(intern=TRUE) on Unix.  You can easily raise it: it is in
> do_system in file src/unix/sys-unix.c.
>
> I think this limit should be raised considerably, but it may well not be
> worth eliminating it.
>
> On Sat, 7 Dec 2002, Naoki Takebayashi wrote:
>
> > Hi,
> >
> > system(cmd, intern=T) seems to have a problem when cmd returns a long
> > character string.
> >
> > For example, if a file (/tmp/long.txt) contains a long string such as:
> >
> >
1234567890123456789012345678901234567890123456789012345678901234567890123456
78901234567890123456789012345678901234567890
> >
> > There are 120 characters in this one line.
> >
> > > junk <- system("cat /tmp/long", TRUE)
> > > junk
> > [1]
"123456789012345678901234567890123456789012345678901234567890123456789012345
6789012345678901234567890123456789012345678"
> > [2] "0"
> > > nchar(junk[1])
> > [1] 118
> >
> > So one long line get separated into two parts, and additionally 119-th
> > character is missing.
> >
> > Is this a bug in R or am I missing something?
> >
> > I tried this on R-1.6.1 on linux/alpha and linux/i386.
> >
> > Thanks,
> > Naoki
> >
> > Naoki Takebayashi     <ntakebay at bio.indiana.edu>
> > --- Dept. of Biology, Box 90338, Duke University, Durham, NC 27708-0338
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
>
> --
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
>
> --__--__--
>
> Message: 6
> Date: Sun, 08 Dec 2002 13:41:11 +1000
> To: r-help at stat.math.ethz.ch
> From: Richard Rowe <Richard.Rowe at jcu.edu.au>
> Subject: [R] color of plot axes involving POSIX types
>
> I am attempting to plot frequency of occurrence against (calendar) time.
As
> the output is to be produced as a Powerpoint picture on a dark background
I
> wish to make the plot output yellow
>
>  > par(col="yellow", col.axis="yellow", col.lab="yellow",
col.main="yellow")
>  > plot(t2, t1, ylim=c(0,40), main="Episynlestes run 2", ylab="frequency",
> type="h", axes=FALSE, lwd=2)
>
> where t2 is a vector of  POSIX type and t1 is the associated frequency.
> This works *except* that the x axis is printed ... and in black
>
>  > axis.POSIXct(1, t2, col="yellow")
>
> makes the x axis yellow by overwriting, so I can get what I want
> (fortunately I didn't post this earlier when I was tied in a knot), but it
> doesn't seem elegant.
>
> Any hints?
>
> Thanks,
>
> Richard
>
>
> Richard Rowe
> Senior Lecturer
> Department of Zoology and Tropical Ecology, James Cook University
> Townsville, Queensland 4811, Australia
> fax (61)7 47 25 1570
> phone (61)7 47 81 4851
> e-mail: Richard.Rowe at jcu.edu.au
> http://www.jcu.edu.au/school/tbiol/zoology/homepage.html
>
>
>
> --__--__--
>
> _______________________________________________
> R-help mailing list  DIGESTED
> R-help at stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>
> End of R-help Digest




More information about the R-help mailing list