[Rd] R 2.1.1 installation fails under Suse 10.0 (PR#8533)
Full_Name: Sigbert Klinke Version: 2.1.1 OS: Suse Linux 10.0 (Full DVD) Submission from: (NULL) (141.20.100.252) Suse 10.0 installs only a Fortran 95 compiler with g77 compability mode. Using this leads in "configure" to an abortion with problems about "FPICFLAGS". Deinstalling g77 compatiblity mode, using f2c, compiles R. But after calling R() the program shows its entrance message and then hangs up, using 100% of the processor capacity. What finally works on my computer was setting a softlink from /usr/bin/g77 to gfortran such that the fortran 95 compiler was used directly during the R compilation. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R 2.1.1 installation fails under Suse 10.0 (PR#8533)
I am afraid 1) This is a message about an outdated version of R, and 2) The problem is most likely the compiler and the way it (mis)compiles src/modules/lapack/dlamc.f. This is covered in the R-admin manual (which INSTALL asked you to read). This said in 2.1.1 It seems that @samp{gcc 3.4.x} and later on @samp{ix86} Linux defeat attempts by the LAPACK code to avoid computations entirely in extended-precision registers, so file @file{src/modules/lapack/dlamc.f} may need to be compiled without optimization. If configure detects @acronym{GNU} Fortran it adds flag @option{-ffloat-store} which suffices, but it is possible that @file{src/modules/lapack/Makefile} will need to be edited to remove optimization on other platforms. and the NEWS for 2.2.0 says o src/modules/lapack/dlamc.f is now compiled with -ffloat-store if f2c/gcc are used, as well as if g77 is used. If the current version of R does not work for you, please ask a question on R-devel describing exactly what you are using (you have not mentioned your cpu type or your compilers, for example) and what the error messages are. On Sun, 29 Jan 2006 [EMAIL PROTECTED] wrote: > Full_Name: Sigbert Klinke > Version: 2.1.1 > OS: Suse Linux 10.0 (Full DVD) > Submission from: (NULL) (141.20.100.252) > > > Suse 10.0 installs only a Fortran 95 compiler Which compiler is this? According to its man page, gfortran is *not* a Fortran 95 compiler, and you have not mentioned what you think is. (I don't believe there is a free F95 compiler for Linux.) > with g77 compability mode. Using this leads in "configure" to an > abortion with problems about "FPICFLAGS". Which were? What happened when you set FPICFLAGS in config.site? > Deinstalling g77 compatiblity > mode, using f2c, compiles R. But after calling R() the program shows its > entrance message and then hangs up, using 100% of the processor > capacity. > > What finally works on my computer was setting a softlink from /usr/bin/g77 to > gfortran such that the fortran 95 compiler was used directly during the R > compilation. -- Brian D. Ripley, [EMAIL PROTECTED] 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 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R 2.1.1 installation fails under Suse 10.0 (PR#8533)
[EMAIL PROTECTED] writes: > Suse 10.0 installs only a Fortran 95 compiler with g77 compability mode. Using > this leads in "configure" to an abortion with problems about "FPICFLAGS". > Deinstalling g77 compatiblity mode, using f2c, compiles R. But after calling > R() > the program shows its entrance message and then hangs up, using 100% of the > processor capacity. > > What finally works on my computer was setting a softlink from /usr/bin/g77 to > gfortran such that the fortran 95 compiler was used directly during the R > compilation. All alpha and beta versions, as well as the final release of 2.2.1 were done on (32bit) SuSE 10.0! Just remember to install *all* the tools, including the gcc-fortran RPM. And install a recent R - older versions may need help to pick up the right Fortran, and as you have noticed gcc4 and gcc3 does not mix and match (so if you insist on using compat-g77, also use compat-gcc). And: It is not considered a bug that versions of R do not work/build with OS releases which didn't exist at the time -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
(Moved from R-help). This comes up often enough that I'm starting to think most functions that take filename arguments should have file.choose() as the default value. Then one could do read.table() and have a dialog box pop up in Windows, or some other prompt for a filename in other platforms. Are there any obviously bad side effects from a change like this? Duncan Murdoch On 1/29/2006 11:51 AM, Peter Dalgaard wrote: > Romain Francois <[EMAIL PROTECTED]> writes: > >> Le 29.01.2006 16:26, oliver wee a écrit : >> >>> hello, I have just started using R for doing a project >>> in time series... >>> >>> unfortunately, I am having trouble using the >>> read.table function for use in reading my data set. >>> >>> This is what I'm getting: >>> I inputted: >>> data <- >>> read.table("D:/Oliver/Professional/Studies/Time Series >>> Analysis/spdc2693.data", header = TRUE) >>> >>> I got: >>> Error in file(file, "r") : unable to open connection >>> In addition: Warning message: >>> cannot open file 'D:/Oliver/Professional/Studies/Time >>> Series Analysis/spdc2693.data', reason 'No such file >>> or directory' >>> >>> as I am just a novice programmer, I really would >>> appreciate help from you guys. Is there a need to >>> setpath in R, like in java or something like that... >>> >>> I am using the windows version btw. >>> >>> I have also tried to put the file in the work >>> directory of R, so that I only typed >>> data <- read.table("spdc2693.data", header = TRUE) >>> Again, it won't work, with the same error message. >>> >>> I would appreciate any help. thanks again. >>> >>> >> Hi, try : >> >> read.table(file.choose(), header=TRUE) >> >> and go to your file. >> Also, you can look a ?setwd, ?getwd > > Right. Or just file.choose() and see what the OS thinks your file is > really called. The most common causes for symptoms like that are > > (A) The file is "spcd2693.data" > (B) There's an extra extension which ever helpful Windows decided to > hide, as in "spdc2693.data.txt". > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Bug in wilcox.test
There is a fairly new bug in wilcox.test in R-2.2.1 (stable). It wasn't there when I last taught nonparametrics in fall 2003. Line 86 of wilcox.test.R achieved.alpha<-2*psignrank(trunc(qu),n) It should be achieved.alpha<-2*psignrank(trunc(qu)-1,n) If you don't see why, decode the cookbook instructions p. 56 in Hollander and Wolfe (2nd ed.) or see http://www.stat.umn.edu/geyer/5601/examp/signrank.html#conf or just do a sanity check: does this to the right thing when the confidence interval is the range of the data, case qu = 1? No. Of course, this error isn't very visible, because wilcox.test still prints the ASKED FOR confidence level instead of the ACTUAL ACHIEVED confidence level (which sucks IMHO, but never mind) except when it incorrectly thinks that the level cannot be achieved, in which case it prints the incorrect achieved level. Just great. To see the bug do X <- read.table(url("http://www.stat.umn.edu/geyer/5601/hwdata/t3-3.txt";), header = TRUE) attach(X) wilcox.test(y, x, paired = TRUE, conf.int = TRUE) and compare with what you get when you change t3-1.txt to t3-3.txt in the Rweb form in http://www.stat.umn.edu/geyer/5601/examp/signrank.html#conf and submit. Sorry to sound so grumpy about this, but I hate having my homework solutions explain that R sucks (in this instance). Better yet, NEVER use wilcox.test. Always use wilcox.exact in exactRankTests or fuzzy.signrank.ci in fuzzyRankTests. X <- read.table(url("http://www.stat.umn.edu/geyer/5601/hwdata/t3-3.txt";), header = TRUE) attach(X) library(fuzzyRankTests) fuzzy.signrank.ci(y - x) prints Wilcoxon signed rank test data: y - x 95 percent confidence interval: Randomized confidence interval is mixture of two intervals probability lower end upper end 0.9 -25 605 0.1 -15 560 Corresponding fuzzy confidence interval is one on the narrower interval, 0.9 elsewhere on the wider interval, and zero outside the wider interval, with values at jumps that are the average of the left and right limits Sorry about the advert. Couldn't resist the opportunity. -- Charles Geyer Professor, School of Statistics University of Minnesota [EMAIL PROTECTED] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] dataentry() (PR#8535)
Full_Name: Greg Kochanski Version: 2.2.1 OS: Debian Linux (testing) Submission from: (NULL) (212.159.16.190) In writing class notes to teach people how to use R, I came across a design failure of dataentry(). It seems that if you add a new value outside the bounds of an array, dataentry() fills the intervening space with NA. That's reasonable, but what happens if you *accidentally* entered a value outside the bounds?There's no way to get rid of it. Note that you are doomed once you type anyting beyond the end of an array, even if you delete your typing before moving the mouse out of the cell -- even then, that cell and others between it and the end of the array will be filled with NA. I would suggest that some mechanism be added to allow arrays to be shortened in the data editor. It would be generally useful, even beyond fixing typing mistakes. (I recognize that you can shorten an array with something like x <- X[1:132], but it should still be possible in the editor.) __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
I would argue against this. If this were the default, that is requiring user interaction, it would break a fair amount of code that I (and I am sure a lot of others have) where automation is critical. A lot of the issues seem to be user errors, file permission errors, hidden extensions as is pointed out below and related issues. If there is a legitimate bug in R resulting in these issues, then let's patch that. However, I don't think that I can recall reproducible situations where a bug in R is the root cause of these problems. Best regards, Marc Schwartz On Sun, 2006-01-29 at 12:18 -0500, Duncan Murdoch wrote: > (Moved from R-help). > > This comes up often enough that I'm starting to think most functions > that take filename arguments should have file.choose() as the default > value. Then one could do > > read.table() > > and have a dialog box pop up in Windows, or some other prompt for a > filename in other platforms. Are there any obviously bad side effects > from a change like this? > > Duncan Murdoch > > On 1/29/2006 11:51 AM, Peter Dalgaard wrote: > > Romain Francois <[EMAIL PROTECTED]> writes: > > > >> Le 29.01.2006 16:26, oliver wee a écrit : > >> > >>> hello, I have just started using R for doing a project > >>> in time series... > >>> > >>> unfortunately, I am having trouble using the > >>> read.table function for use in reading my data set. > >>> > >>> This is what I'm getting: > >>> I inputted: > >>> data <- > >>> read.table("D:/Oliver/Professional/Studies/Time Series > >>> Analysis/spdc2693.data", header = TRUE) > >>> > >>> I got: > >>> Error in file(file, "r") : unable to open connection > >>> In addition: Warning message: > >>> cannot open file 'D:/Oliver/Professional/Studies/Time > >>> Series Analysis/spdc2693.data', reason 'No such file > >>> or directory' > >>> > >>> as I am just a novice programmer, I really would > >>> appreciate help from you guys. Is there a need to > >>> setpath in R, like in java or something like that... > >>> > >>> I am using the windows version btw. > >>> > >>> I have also tried to put the file in the work > >>> directory of R, so that I only typed > >>> data <- read.table("spdc2693.data", header = TRUE) > >>> Again, it won't work, with the same error message. > >>> > >>> I would appreciate any help. thanks again. > >>> > >>> > >> Hi, try : > >> > >> read.table(file.choose(), header=TRUE) > >> > >> and go to your file. > >> Also, you can look a ?setwd, ?getwd > > > > Right. Or just file.choose() and see what the OS thinks your file is > > really called. The most common causes for symptoms like that are > > > > (A) The file is "spcd2693.data" > > (B) There's an extra extension which ever helpful Windows decided to > > hide, as in "spdc2693.data.txt". > > > > > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
On 1/29/2006 12:55 PM, Marc Schwartz wrote: > I would argue against this. > > If this were the default, that is requiring user interaction, it would > break a fair amount of code that I (and I am sure a lot of others have) > where automation is critical. I don't see how this change could affect any code that currently works -- maybe you misunderstood the proposal? I'm just suggesting that the args to functions that take input from files use file.choose() as a default. For example, read.table's arg list would change from function (file, header = FALSE, ... to function (file = file.choose(), header = FALSE, ... Currently a call like read.table() dies with an error message: > read.table() Error in read.table() : argument "file" is missing, with no default With this change we wouldn't get an error here. > > A lot of the issues seem to be user errors, file permission errors, > hidden extensions as is pointed out below and related issues. If there > is a legitimate bug in R resulting in these issues, then let's patch > that. However, I don't think that I can recall reproducible situations > where a bug in R is the root cause of these problems. This isn't about fixing a bug, it's about making the user interface a bit less error-prone. Duncan Murdoch > > Best regards, > > Marc Schwartz > > On Sun, 2006-01-29 at 12:18 -0500, Duncan Murdoch wrote: >> (Moved from R-help). >> >> This comes up often enough that I'm starting to think most functions >> that take filename arguments should have file.choose() as the default >> value. Then one could do >> >> read.table() >> >> and have a dialog box pop up in Windows, or some other prompt for a >> filename in other platforms. Are there any obviously bad side effects >> from a change like this? >> >> Duncan Murdoch >> >> On 1/29/2006 11:51 AM, Peter Dalgaard wrote: >>> Romain Francois <[EMAIL PROTECTED]> writes: >>> Le 29.01.2006 16:26, oliver wee a écrit : > hello, I have just started using R for doing a project > in time series... > > unfortunately, I am having trouble using the > read.table function for use in reading my data set. > > This is what I'm getting: > I inputted: > data <- > read.table("D:/Oliver/Professional/Studies/Time Series > Analysis/spdc2693.data", header = TRUE) > > I got: > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file 'D:/Oliver/Professional/Studies/Time > Series Analysis/spdc2693.data', reason 'No such file > or directory' > > as I am just a novice programmer, I really would > appreciate help from you guys. Is there a need to > setpath in R, like in java or something like that... > > I am using the windows version btw. > > I have also tried to put the file in the work > directory of R, so that I only typed > data <- read.table("spdc2693.data", header = TRUE) > Again, it won't work, with the same error message. > > I would appreciate any help. thanks again. > > Hi, try : read.table(file.choose(), header=TRUE) and go to your file. Also, you can look a ?setwd, ?getwd >>> Right. Or just file.choose() and see what the OS thinks your file is >>> really called. The most common causes for symptoms like that are >>> >>> (A) The file is "spcd2693.data" >>> (B) There's an extra extension which ever helpful Windows decided to >>> hide, as in "spdc2693.data.txt". >>> >>> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] mosaicplot() labels overlap (PR#8536)
Full_Name: Greg Kochanski Version: 2.2.1 OS: Debian Linux (testing) Submission from: (NULL) (212.159.16.190) This is really a feature request. When you do mosaicplot() on a data set where the probability of several nearby rows is small, then the labels for those rows are plotted overlapping each other. This situation can be improved by calling mosaicplot() with a large value of "off", but sometimes, even off=50 (the largest allowable value) isn't sufficient, especially if the labels are several characters long. The problem exists even if the labels don't overlap, because one needs space between the labels to avoid confusion. For instance, labels "L*H", "!H*", and "L%" when too close together turn into "L*H!H*L%" which is confusing to anyone. The problem could be solved by breaking the assumption that the label position need always be exactly matched to the graphic.This is OK, especially for rows because (a) the graphical blocks that are part of a single row aren't aligned with each other anyway, and (b) if you can read the labels, you can generally match things up by counting. One way to do this in a fairly nice way is to position the labels in such a way to minimize the sum of the squared error between the label center and the average position of the blocks on that row, subject to the constraint that labels be non-overlapping. This problem is actually not too hard to solve: it is essentially Kruskal's algorithm for finding a best-fit monotonic sequence (which probably exists in CRAN already). Neglecting edge effects, assume you have a vector of desired positions z, and a vector of minimum widths for each label w. Then, you can compute the space used up by the labels: s[i] = -0.5*w[1] + sum(jhttps://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
On Sun, 29 Jan 2006, Marc Schwartz wrote: I would argue against this. If this were the default, that is requiring user interaction, it would break a fair amount of code that I (and I am sure a lot of others have) where automation is critical. I don't see how. The current default is read.table() Error in read.table() : argument "file" is missing, with no default so the only change is that the default might do something useful. Nor do I see the change would help, as the same people would still use a character string for 'file' and not omit the argument. (It seems very unlikely that they would read any documentation that suggested things had changed.) The same issue could be made over scan(), where the current default is useful. A lot of the issues seem to be user errors, file permission errors, hidden extensions as is pointed out below and related issues. If there is a legitimate bug in R resulting in these issues, then let's patch that. However, I don't think that I can recall reproducible situations where a bug in R is the root cause of these problems. Nor I. Note that file.choose does not protect you against file permission issues (actually, on a command-line Unix-alike it does nothing much useful at all): readLines(file.choose()) Enter file name: errs.txt Error in file(con, "r") : unable to open connection In addition: Warning message: cannot open file 'errs.txt', reason 'Permission denied' but file.show(file.choose()) says NO FILE errs.txt which is not a good idea (and I will improve). So this would really only have any effect on GUI platforms, for people who read the documentation. Best regards, Marc Schwartz On Sun, 2006-01-29 at 12:18 -0500, Duncan Murdoch wrote: (Moved from R-help). This comes up often enough that I'm starting to think most functions that take filename arguments should have file.choose() as the default value. Then one could do read.table() and have a dialog box pop up in Windows, or some other prompt for a filename in other platforms. Are there any obviously bad side effects from a change like this? Duncan Murdoch On 1/29/2006 11:51 AM, Peter Dalgaard wrote: Romain Francois <[EMAIL PROTECTED]> writes: Le 29.01.2006 16:26, oliver wee a écrit : hello, I have just started using R for doing a project in time series... unfortunately, I am having trouble using the read.table function for use in reading my data set. This is what I'm getting: I inputted: data <- read.table("D:/Oliver/Professional/Studies/Time Series Analysis/spdc2693.data", header = TRUE) I got: Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file 'D:/Oliver/Professional/Studies/Time Series Analysis/spdc2693.data', reason 'No such file or directory' as I am just a novice programmer, I really would appreciate help from you guys. Is there a need to setpath in R, like in java or something like that... I am using the windows version btw. I have also tried to put the file in the work directory of R, so that I only typed data <- read.table("spdc2693.data", header = TRUE) Again, it won't work, with the same error message. I would appreciate any help. thanks again. Hi, try : read.table(file.choose(), header=TRUE) and go to your file. Also, you can look a ?setwd, ?getwd Right. Or just file.choose() and see what the OS thinks your file is really called. The most common causes for symptoms like that are (A) The file is "spcd2693.data" (B) There's an extra extension which ever helpful Windows decided to hide, as in "spdc2693.data.txt". __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, [EMAIL PROTECTED] 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 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Mosaicplot coloring (PR#8537)
Full_Name: Greg Kochanski Version: 2.2.1 OS: Debian Linux (testing) Submission from: (NULL) (212.159.16.190) mosaicplot(x, shade=TRUE) is intended to color the blocks blue if they are more common than one might expect and red if they are rarer than one might expect. Unfortunately, if a block is much rarer than expected, it is so narrow that one cannot see the red.Thus, a casual inspection of the mosaicplot will miss some of the most statistically significant results. This is partially an intrinsic problem and cannot be entirely fixed, but it is made worse by the black outlines around each block.Blocks with very small probabilities show as black, not red. The broken outlines on the red blocks help, but not quite enough. I would suggest that there be an option to either turn off the black outlines when for the colored blocks, or an option to use colored outlines. If those options are somehow hidden in the ... part of the argument list for mosaicplot(), I apologize, but then this bug report should be converted to a documentation bug. Nowhere in help(mosaicplot) does it say what one can put into the unspecified arguments (...). __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
Duncan, OK. I mis-understood the proposal. My error. Thanks for the clarification. Marc On Sun, 2006-01-29 at 13:08 -0500, Duncan Murdoch wrote: > On 1/29/2006 12:55 PM, Marc Schwartz wrote: > > I would argue against this. > > > > If this were the default, that is requiring user interaction, it would > > break a fair amount of code that I (and I am sure a lot of others have) > > where automation is critical. > > I don't see how this change could affect any code that currently works > -- maybe you misunderstood the proposal? I'm just suggesting that the > args to functions that take input from files use file.choose() as a > default. For example, read.table's arg list would change from > > function (file, header = FALSE, ... > > to > > function (file = file.choose(), header = FALSE, ... > > Currently a call like read.table() dies with an error message: > > > read.table() > Error in read.table() : argument "file" is missing, with no default > > With this change we wouldn't get an error here. > > > > > A lot of the issues seem to be user errors, file permission errors, > > hidden extensions as is pointed out below and related issues. If there > > is a legitimate bug in R resulting in these issues, then let's patch > > that. However, I don't think that I can recall reproducible situations > > where a bug in R is the root cause of these problems. > > This isn't about fixing a bug, it's about making the user interface a > bit less error-prone. > > Duncan Murdoch > > > > > Best regards, > > > > Marc Schwartz > > > > On Sun, 2006-01-29 at 12:18 -0500, Duncan Murdoch wrote: > >> (Moved from R-help). > >> > >> This comes up often enough that I'm starting to think most functions > >> that take filename arguments should have file.choose() as the default > >> value. Then one could do > >> > >> read.table() > >> > >> and have a dialog box pop up in Windows, or some other prompt for a > >> filename in other platforms. Are there any obviously bad side effects > >> from a change like this? > >> > >> Duncan Murdoch > >> > >> On 1/29/2006 11:51 AM, Peter Dalgaard wrote: > >>> Romain Francois <[EMAIL PROTECTED]> writes: > >>> > Le 29.01.2006 16:26, oliver wee a écrit : > > > hello, I have just started using R for doing a project > > in time series... > > > > unfortunately, I am having trouble using the > > read.table function for use in reading my data set. > > > > This is what I'm getting: > > I inputted: > > data <- > > read.table("D:/Oliver/Professional/Studies/Time Series > > Analysis/spdc2693.data", header = TRUE) > > > > I got: > > Error in file(file, "r") : unable to open connection > > In addition: Warning message: > > cannot open file 'D:/Oliver/Professional/Studies/Time > > Series Analysis/spdc2693.data', reason 'No such file > > or directory' > > > > as I am just a novice programmer, I really would > > appreciate help from you guys. Is there a need to > > setpath in R, like in java or something like that... > > > > I am using the windows version btw. > > > > I have also tried to put the file in the work > > directory of R, so that I only typed > > data <- read.table("spdc2693.data", header = TRUE) > > Again, it won't work, with the same error message. > > > > I would appreciate any help. thanks again. > > > > > Hi, try : > > read.table(file.choose(), header=TRUE) > > and go to your file. > Also, you can look a ?setwd, ?getwd > >>> Right. Or just file.choose() and see what the OS thinks your file is > >>> really called. The most common causes for symptoms like that are > >>> > >>> (A) The file is "spcd2693.data" > >>> (B) There's an extra extension which ever helpful Windows decided to > >>> hide, as in "spdc2693.data.txt". > >>> > >>> > >> __ > >> R-devel@r-project.org mailing list > >> https://stat.ethz.ch/mailman/listinfo/r-devel > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
On 1/29/2006 1:29 PM, Prof Brian Ripley wrote: > On Sun, 29 Jan 2006, Marc Schwartz wrote: > >> I would argue against this. >> >> If this were the default, that is requiring user interaction, it would >> break a fair amount of code that I (and I am sure a lot of others have) >> where automation is critical. > > I don't see how. The current default is > >> read.table() > Error in read.table() : argument "file" is missing, with no default > > so the only change is that the default might do something useful. > > Nor do I see the change would help, as the same people would still use a > character string for 'file' and not omit the argument. (It seems very > unlikely that they would read any documentation that suggested things had > changed.) No, but people teaching new users (or answering R-help questions) would have a simpler answer: just use read.table(). > The same issue could be made over scan(), where the current default is > useful. scan() is very useful for small reads, and rarely needed for reading big formatted files, so I wouldn't propose to change it. The inconsistency with read.table would be unfortunate, but no worse than the current one. >> A lot of the issues seem to be user errors, file permission errors, >> hidden extensions as is pointed out below and related issues. If there >> is a legitimate bug in R resulting in these issues, then let's patch >> that. However, I don't think that I can recall reproducible situations >> where a bug in R is the root cause of these problems. > > Nor I. > > Note that file.choose does not protect you against file permission issues > (actually, on a command-line Unix-alike it does nothing much useful at > all): > >> readLines(file.choose()) > Enter file name: errs.txt No, it's not helpful here, but again it makes things no worse, and there's always the possibility that someone would improve file.choose(). Duncan Murdoch > Error in file(con, "r") : unable to open connection > In addition: Warning message: > cannot open file 'errs.txt', reason 'Permission denied' > > but > >> file.show(file.choose()) > says > > NO FILE errs.txt > > which is not a good idea (and I will improve). > > So this would really only have any effect on GUI platforms, for people who > read the documentation. > > >> Best regards, >> >> Marc Schwartz >> >> On Sun, 2006-01-29 at 12:18 -0500, Duncan Murdoch wrote: >>> (Moved from R-help). >>> >>> This comes up often enough that I'm starting to think most functions >>> that take filename arguments should have file.choose() as the default >>> value. Then one could do >>> >>> read.table() >>> >>> and have a dialog box pop up in Windows, or some other prompt for a >>> filename in other platforms. Are there any obviously bad side effects >>> from a change like this? >>> >>> Duncan Murdoch >>> >>> On 1/29/2006 11:51 AM, Peter Dalgaard wrote: Romain Francois <[EMAIL PROTECTED]> writes: > Le 29.01.2006 16:26, oliver wee a écrit : > >> hello, I have just started using R for doing a project >> in time series... >> >> unfortunately, I am having trouble using the >> read.table function for use in reading my data set. >> >> This is what I'm getting: >> I inputted: >> data <- >> read.table("D:/Oliver/Professional/Studies/Time Series >> Analysis/spdc2693.data", header = TRUE) >> >> I got: >> Error in file(file, "r") : unable to open connection >> In addition: Warning message: >> cannot open file 'D:/Oliver/Professional/Studies/Time >> Series Analysis/spdc2693.data', reason 'No such file >> or directory' >> >> as I am just a novice programmer, I really would >> appreciate help from you guys. Is there a need to >> setpath in R, like in java or something like that... >> >> I am using the windows version btw. >> >> I have also tried to put the file in the work >> directory of R, so that I only typed >> data <- read.table("spdc2693.data", header = TRUE) >> Again, it won't work, with the same error message. >> >> I would appreciate any help. thanks again. >> >> > Hi, try : > > read.table(file.choose(), header=TRUE) > > and go to your file. > Also, you can look a ?setwd, ?getwd Right. Or just file.choose() and see what the OS thinks your file is really called. The most common causes for symptoms like that are (A) The file is "spcd2693.data" (B) There's an extra extension which ever helpful Windows decided to hide, as in "spdc2693.data.txt". >>> __ >>> R-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-devel >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > __ R-devel@r-project.org mailing list https://stat.ethz
Re: [Rd] [R] help with read.table() function
On 1/29/2006 1:24 PM, Gabor Grothendieck wrote: > Normally one expects stdin to be the default on command line > programs and something like file.choose to be the default on GUI > programs and this would break that expectation. We don't currently meet that expectation, so I don't think it would make things any worse. As I mentioned to Brian, I wouldn't change the default for scan() (which is stdin everywhere). I haven't done a complete survey yet, but after looking at a few, I think the rules I would use are these: - the function should use the filename argument to find an existing file - it should not already have a default - it should be something that would commonly be used interactively Ones I would change which currently give an error with no filename: read.table() and friends dget() read.dcf() source() read.ftable() tkpager() md5sum() Rd_parse() Ones I probably wouldn't touch: unz() file.create(), etc. file() gives a temporary file for writing dput(), write.dcf() write to the console dev2bitmap(), bitmap() file.show() - which might be called with an empty file list, which we should treat as a no-op Ones I'm not sure about right now, because they're relatively obscure: sys.source() shell.exec() Duncan Murdoch > > If there were a GUI version of read.table then that would reasonbly > have file.choose as the default. > > On 1/29/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> On 1/29/2006 11:28 AM, oliver wee wrote: >>> hi, >>> >>> Sorry again to bother you, but I got the file.choose() >>> to work. Thanks for the help there. >>> >>> Unfortunately I encountered a new problem. After I >>> selected the data, I got this error message: >>> >>> Error in scan(file = file, what = what, sep = sep, >>> quote = quote, dec = dec, : >>> line 1 did not have 11 elements >>> In addition: Warning message: >>> incomplete final line found by readTableHeader on >>> 'D:\Oliver\Professional\Studies\Time Series >>> Analysis\spdc2693.data.txt' >>> >>> my time series data looks like this... >>> >>> >>> Standard and Poor's 500 Index closing values from 1926 >>> to 1993. >>> >>> Date Index >>> 260101 12.76 >>> 260108 12.78 >>> 260115 12.52 >>> 260122 12.45 >>> 260129 12.74 >>> 260205 12.87 >>> 260212 12.87 >>> 260219 12.74 >>> 260226 12.18 >>> 260305 11.99 >>> 260312 12.15 >>> 260319 11.64 >>> 260326 11.46 >>> ... >>> (and so on) >>> -- >>> >>> Should I insert additional attributes besides header = >>> TRUE? >> Yes, you need to tell it to skip over the lines of the comment at the >> start of the file. That looks like 3 lines (including the blank line), >> so add skip=3 to your read.table call. >> >> Duncan Murdoch >> >>> thanks. >>> >>> >>> --- Duncan Murdoch <[EMAIL PROTECTED]> wrote: >>> On 1/29/2006 10:26 AM, oliver wee wrote: > hello, I have just started using R for doing a project > in time series... > > unfortunately, I am having trouble using the > read.table function for use in reading my data set. > This is what I'm getting: > I inputted: > data <- > read.table("D:/Oliver/Professional/Studies/Time Series > Analysis/spdc2693.data", header = TRUE) Generally it's easier to use the dialogs to specify the filename, e.g. read.table(file.choose(), header=TRUE) Then you shouldn't get the "no such file" message. If you do, you should check whether other programs (e.g. notepad) can open the file. Maybe you don't have read permission? Duncan Murdoch > I got: > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file 'D:/Oliver/Professional/Studies/Time > Series Analysis/spdc2693.data', reason 'No such file > or directory' > > as I am just a novice programmer, I really would > appreciate help from you guys. Is there a need to > setpath in R, like in java or something like that... > I am using the windows version btw. > > I have also tried to put the file in the work > directory of R, so that I only typed > data <- read.table("spdc2693.data", header = TRUE) > Again, it won't work, with the same error message. > > I would appreciate any help. thanks again. > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >>> >>> __ >>> Do You Yahoo!? >>> Tired of spam? Yahoo! Mail has the best spam protection around >>> http://mail.yahoo.com >> _
Re: [Rd] [R] help with read.table() function
On 1/29/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 1/29/2006 1:24 PM, Gabor Grothendieck wrote: > > Normally one expects stdin to be the default on command line > > programs and something like file.choose to be the default on GUI > > programs and this would break that expectation. > > We don't currently meet that expectation, so I don't think it would make > things any worse. As I mentioned to Brian, I wouldn't change the II don't think you understood my point. This is how most software works, IN GENERAL, so R should be expected to work that way too. I don't think not having a default is so bad but having the wrong default that breaks the stereotype that one expects in all software is bad. What could be done is to add something about file.choose to the error message that one gets when one does read.table("myfile") and it can't find "myfile". __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
On 1/29/2006 5:20 PM, Gabor Grothendieck wrote: > On 1/29/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: >> On 1/29/2006 1:24 PM, Gabor Grothendieck wrote: >> > Normally one expects stdin to be the default on command line >> > programs and something like file.choose to be the default on GUI >> > programs and this would break that expectation. >> >> We don't currently meet that expectation, so I don't think it would make >> things any worse. As I mentioned to Brian, I wouldn't change the > > II don't think you understood my point. This is how most software works, > IN GENERAL, so R should be expected to work that way > too. I think I understood that, but my point is that R doesn't act that way now, and this change won't make the situation worse. >I don't think not having a default is so bad but having the wrong > default that breaks the stereotype that one expects in all software > is bad. I don't follow your argument. Why is it better to say Error in read.table() : argument "file" is missing, with no default than it would be to ask the user which file to read? The first is unexpected in both of the situations you described, while the second is only unexpected in a command line program. Consistency is a good thing, but there are a number of choices of what to be consistent with: - other similar functions in R (but they are inconsistent) - previous versions of R (which is why I wouldn't change scan()) - other software a user would be familiar with (which is why file.choose() is a good idea in a GUI, but not in a command line program). > What could be done is to add something about file.choose to the > error message that one gets when one does read.table("myfile") > and it can't find "myfile". Currently our error messages explain what went wrong, they generally don't try to suggest alternative approaches (though a few do, e.g. help("dfdsfs")). There are a lot of reasons read.table() could fail, and I think it would be very hard to get a good automatic rule on when file.choose() was the appropriate alternative. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Citation of R packages
The bibtex citations provided by citation() do not work all that well in cases where there is no printed document to reference: (1) A version field is needed, as the note field is required for other purposes, currently trying to sort out nuances that cannot be sorted out in the author list (author, compiler, implementor of R version, contributor, ...) and maybe giving a cross-reference to a book or paper that is somehow relevant. (2) Maybe the author field should be more nuanced, or maybe ... (3) In compiling a list of packages, name order seems preferable, and one wants the title first (achieved by relocating the format.title field in the manual FUNCTION in the .bst file (4) manual seems not an ideal name for the class, if there is no manual. Maybe what is needed is a package or suchlike class, and several alternative .bst files that handle the needed listings. I know at least one other person who is wrestling with this, and others on this list must be wrestling with it. John Maindonald email: [EMAIL PROTECTED] phone : +61 2 (6125)3473fax : +61 2(6125)5549 Mathematical Sciences Institute, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] help with read.table() function
On 1/29/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 1/29/2006 5:20 PM, Gabor Grothendieck wrote: > > On 1/29/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> On 1/29/2006 1:24 PM, Gabor Grothendieck wrote: > >> > Normally one expects stdin to be the default on command line > >> > programs and something like file.choose to be the default on GUI > >> > programs and this would break that expectation. > >> > >> We don't currently meet that expectation, so I don't think it would make > >> things any worse. As I mentioned to Brian, I wouldn't change the > > > > II don't think you understood my point. This is how most software works, > > IN GENERAL, so R should be expected to work that way > > too. > > I think I understood that, but my point is that R doesn't act that way > now, and this change won't make the situation worse. > > >I don't think not having a default is so bad but having the wrong > > default that breaks the stereotype that one expects in all software > > is bad. > > I don't follow your argument. Why is it better to say > > Error in read.table() : argument "file" is missing, with no default Because that does not mix conventions. > > than it would be to ask the user which file to read? The first is > unexpected in both of the situations you described, while the second is > only unexpected in a command line program. Because its conventional that stdin is the default. Even in R someone must have realized that since that is the default for scan. > > Consistency is a good thing, but there are a number of choices of what > to be consistent with: > > - other similar functions in R (but they are inconsistent) > - previous versions of R (which is why I wouldn't change scan()) > - other software a user would be familiar with (which is why > file.choose() is a good idea in a GUI, but not in a command line program). > > > What could be done is to add something about file.choose to the > > error message that one gets when one does read.table("myfile") > > and it can't find "myfile". > > Currently our error messages explain what went wrong, they generally > don't try to suggest alternative approaches (though a few do, e.g. > help("dfdsfs")). There are a lot of reasons read.table() could fail, > and I think it would be very hard to get a good automatic rule on when > file.choose() was the appropriate alternative. I wasn't suggesting an automatic solution but I think it could be helpful if the error message pointed out the existence of file.choose. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] colnames(tapply(...)) (PR#8539)
I would like to bring to your attention the following error message which didn't appear on previous versions (long time ago?) Thanks for all your effort Karl Version 2.2.1 Patched (2006-01-21 r37153) > f <- rep(c(1,2),each=5) > x <- tapply(f,f,sum) > colnames(x) Error in dn[[2]] : subscript out of bounds --- Karl Thomaseth, Ph.D. Research Director National Research Council Institute of Biomedical Engineering ISIB-CNR Corso Stati Uniti 4 35127 Padova, ITALY http://www.isib.cnr.it/~karl/ tel.: (+39) 049 8295762, fax: (+39) 049 8295763 [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel