Hi I have installed R-1.9.1 on an 6 year old Sun running Solaris 2.6. After some initial failures to compile I used the : gcc 2.7.2.3 f77 compilers with gnu make. [could not get gcc 3.4.1 to compile] All but one of the .c programs compiled [that being src/main/connections.c which I manually compiled using cc] and the make check tests all worked [apart from the internet]. However I get the following, where weight is a column vector :> np <- sum(weight) > n <- nrow(weight) > weight <- as.single((n*weight)/np)Error in structure(.Internal(as.vector(x, "double")), Csingle = TRUE) : (list) object cannot be coerced to double> dim(weight)[1] 38 1> version_ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 9.1 year 2004 month 06 day 21 language R I have searched the R-help and R-devel archives but not seen anything directly relevant. Any help would be much appreciated. Thanks Ray Lindsay Senior Statistician Natural Resources Branch ABARE Canberra Australia +61-2-6272 2215 ---------------------------------------------------------------------- IMPORTANT - This message has been issued by The Department of Agriculture, Fisheries and Forestry (DAFF). The information transmitted is for the use of the intended recipient only and may contain confidential and/or legally privileged material. It is your responsibility to check any attachments for viruses and defects before opening or sending them on. Any reproduction, publication, communication, re-transmission, disclosure, dissemination or other use of the information contained in this e-mail by persons or entities other than the intended recipient is prohibited. The taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error please notify the sender and delete all copies of this transmission together with any attachments. If you have received this e-mail as part of a valid mailing list and no longer want to receive a message such as this one advise the sender by return e-mail accordingly. Only e-mail correspondence which includes this footer, has been authorised by DAFF
On Fri, 17 Sep 2004 Ray.Lindsay at abare.gov.au wrote:> Hi > I have installed R-1.9.1 on an 6 year old Sun running Solaris 2.6. After some initial failures to compile I used the : > gcc 2.7.2.3 > f77 > compilers with gnu make. [could not get gcc 3.4.1 to compile] > All but one of the .c programs compiled > [that being src/main/connections.c which I manually compiled using cc]and the Out of curiosity, what was the error with ancient gcc?> make check > tests all worked [apart from the internet]. > > However I get the following, where weight is a column vector :There is no such thing in R (only vectors and 1D arrays). What does str(weight) say? Here's my guess: weight <- data.frame(x=rnorm(38)) reproduces your error. So I think you have a one-column data frame, and you meant weight[[1]] (or weight[, 1] or weight[1]). Next, why are you calling as.single? This is not in the context which the help page says is the *only* place it should be used.> > np <- sum(weight) > > n <- nrow(weight) > > weight <- as.single((n*weight)/np) > Error in structure(.Internal(as.vector(x, "double")), Csingle = TRUE) : > (list) object cannot be coerced to double > > dim(weight) > [1] 38 1-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595