[R] Question on sub(stitute) X_1 - X\_1

2006-12-01 Thread Christian Hoffmann
Hi, Searching the archives has brought no clue: For a tex chunk in an Sweave text Oracle query results: differences \Sexpr{varname},... I need to change the string varname from X_1 to X\_1, sub(_,??,X_+) - X\_1 so that subsequent Latex will generate X_1 (i.e. show the underscore) instead

Re: [R] Vertical line in densityplot?

2006-12-01 Thread Gustaf Rydevik
On 12/1/06, Thomas Petzoldt [EMAIL PROTECTED] wrote: Hi, lattice graphics work by utilizing so called panel functions. Here is a working version of your example: library(lattice) x-rnorm(100) plot.new() densityplot(x, panel=function(x, ...){ panel.densityplot(x, ...)

Re: [R] analog to the matlab buffer function?

2006-12-01 Thread Robin Hankin
do.call(rbind,lapply(0:4,function(i){i+(1:5)})) [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]23456 [3,]34567 [4,]45678 [5,]56789 On 1 Dec 2006, at 00:32, Charles C. Berry wrote: See

[R] RKward installation problem

2006-12-01 Thread İbrahim Mutlay
Dear R users, Recenty i tried to install the R GUI of RKward, but i think something is wrong. In installation, i used the command such like: [EMAIL PROTECTED]:/usr/lib/rkward# ./configure --enable-R-shlib or, [EMAIL PROTECTED]:/usr/lib/rkward# ./configure --enable-R-shlib

[R] Box Tidwell / Error Message

2006-12-01 Thread Simon P. Kempf
Dear R-Users, I used the box.tidwell () function of the car Package. When I used the following formula: semi.sub.in.mi1.boxtidwell_h-box.tidwell(RENT_LG ~ I(age+1)+I(age2+1)+X06A + I(X08B+1) + I(X22+1) + I(X24+1) + X31A, ~B_YEAR + C_X01 + C_X14 + C_X19 + C_X29A +C_X21 + C_X23 + D_X12

Re: [R] Question on sub(stitute) X_1 - X\_1

2006-12-01 Thread Prof Brian Ripley
You are confusing the printed representation with the string (a clue which is all over the archives, and in ?regex). X1 - sub(_,\\_,X_1,fixed=TRUE) print(X1) cat(X1, \n) X2 - sub(_,_,X_1) cat(X1, \n) both do as you ask. On Fri, 1 Dec 2006, Christian Hoffmann wrote: Hi, Searching the

[R] specify point shape for ggplot (equivalent to pch)?

2006-12-01 Thread Rainer M Krug
Hi is it possible to specify the shape of the point to be used in ggplot (as with pch in plot)? I couldn't find anything in the help. Thanks Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of

Re: [R] Aggregating data

2006-12-01 Thread Petr Pikal
Hi On 29 Nov 2006 at 10:26, David Kaplan wrote: Date sent: Wed, 29 Nov 2006 10:26:32 -0600 From: David Kaplan [EMAIL PROTECTED] To: Petr Pikal [EMAIL PROTECTED] Copies to: r-help@stat.math.ethz.ch Subject:Re: [R]

Re: [R] Quicker way of combining vectors into a data.frame

2006-12-01 Thread Gavin Simpson
[ Resending to the list as I fell foul of the too many recipients rule ] On Thu, 2006-11-30 at 11:34 -0600, Marc Schwartz wrote: Thanks to Marc, Prof. Ripley, Sebastian and Sebastian (Luque - offline) for your comments and suggestions. I noticed that two of the vectors were named and so I

Re: [R] writing function with ,... )

2006-12-01 Thread Carmen Meier
Thanks, a lot I was not able to find it the hole day ... Carmen Phil Spector schrieb: Carmen - You certainly can write functions that use ..., but you need to extract the arguments that the dots represent with list(). Here's a modified version of your function that may help explain how

Re: [R] Quicker way of combining vectors into a data.frame

2006-12-01 Thread Peter Dalgaard
Gavin Simpson wrote: [ Resending to the list as I fell foul of the too many recipients rule ] On Thu, 2006-11-30 at 11:34 -0600, Marc Schwartz wrote: Thanks to Marc, Prof. Ripley, Sebastian and Sebastian (Luque - offline) for your comments and suggestions. I noticed that two of the vectors

[R] A different contingency table of counts by case

2006-12-01 Thread Serguei Kaniovski
Dear All, the following code, by courtesy of Jacques VESLOT, collates the following contingency table from DATA (read in as df, sample listed below) led represents (court) cases, jid the (justices) persons, and vote is the binary state. The command: smat-t(apply(combinations(nlevels(df$jid),

Re: [R] Quicker way of combining vectors into a data.frame

2006-12-01 Thread Gavin Simpson
On Fri, 2006-12-01 at 12:13 +0100, Peter Dalgaard wrote: Gavin Simpson wrote: snip / I just don't understand what is going on with data.frame. I think there is something about the data you're not telling us... Yes, that I was doing something very, very silly that I thought would work

Re: [R] Dummies multiplied with other variable (solved)

2006-12-01 Thread Andreas Goesele
David Barron [EMAIL PROTECTED] writes: I'm not sure if this will help, but it's worth a try. Do the regression as I suggested before, extract the model matrix and remove the offending column. I'm assuming you don't know in advance how many levels there are in the factor. Then use this to

[R] simple parallel computing on single multicore machine

2006-12-01 Thread Millo Giovanni
Dear List, the advent of multicore machines in the consumer segment makes me wonder whether it would, at least in principle, be possible to divide a computational task into more slave R processes running on the different cores of the same processor, more or less in the way package SNOW would do

[R] C structures in R

2006-12-01 Thread Barry Rowlingson
Is it safe to call C code from R that mallocs memory for a structure, returning a pointer to that structure via some 'raw()' parameter. Then, pass that pointer to another C routine, and finally free the malloced memory by passing the raw() data to another C routine? I've written some code that

Re: [R] simple parallel computing on single multicore machine

2006-12-01 Thread Uwe Ligges
Millo Giovanni wrote: Dear List, the advent of multicore machines in the consumer segment makes me wonder whether it would, at least in principle, be possible to divide a computational task into more slave R processes running on the different cores of the same processor, more or less in

Re: [R] simple parallel computing on single multicore machine

2006-12-01 Thread Peter Dalgaard
Millo Giovanni wrote: Dear List, the advent of multicore machines in the consumer segment makes me wonder whether it would, at least in principle, be possible to divide a computational task into more slave R processes running on the different cores of the same processor, more or less in the

Re: [R] simple parallel computing on single multicore machine

2006-12-01 Thread Ramon Diaz-Uriarte
On Friday 01 December 2006 13:23, Millo Giovanni wrote: Dear List, the advent of multicore machines in the consumer segment makes me wonder whether it would, at least in principle, be possible to divide a computational task into more slave R processes running on the different cores of the

Re: [R] C structures in R

2006-12-01 Thread Prof Brian Ripley
Isn't this a question clearly in R-devel's domain? R-devel is intended for questions and discussion about code development in R. Questions likely to prompt discussion unintelligible to non-programmers should go to to R-devel. The short answer is that quite a bit of code, e.g pwilcox and

Re: [R] *** caught segfault *** error

2006-12-01 Thread Juanjo Abellan
Dear all, The shapefile was generated with ArcGIS 9.0 running on Windows XP. It can be can be found in www.uv.es/~abellan/districts_ok.zip. Re running sessionInfo() before the error occurres as suggested by Prof. Ripley: library(spdep) Loading required package: tripack Loading required

[R] generate the time series data

2006-12-01 Thread Wang Xian
I want to generate a bivariate time series data with given joint distribution. Let's say Yt = A + B*Yt-1 + Vt, where Yt = (Y1t,Y2t)'. The dependence between Y1t and Y2t is measured by a given copula function. I.e., C(F(Y1t), G(Y2t)) = H(Y1t,Y2t), where C is a copula function, F and G are the

Re: [R] AIC for heckit

2006-12-01 Thread Jay Emerson
I have used the heckit function in micEcon. ... How can I then get the AIC for this model? It appears that the heckit $probit object is of class 'glm' and so, for example: main.result - heckit(whateveryouaredoing)# Do your heckit()... probit.result - main.result$probit # The

Re: [R] Quicker way of combining vectors into a data.frame

2006-12-01 Thread Marc Schwartz
On Thu, 2006-11-30 at 19:26 +, Gavin Simpson wrote: On Thu, 2006-11-30 at 11:34 -0600, Marc Schwartz wrote: Thanks to Marc, Prof. Ripley, Sebastian and Sebastian (Luque - offline) for your comments and suggestions. I noticed that two of the vectors were named and so I removed the names

Re: [R] *** caught segfault *** error

2006-12-01 Thread Prof Brian D Ripley
On Fri, 1 Dec 2006, Juanjo Abellan wrote: [...] Sorry, I didn't understand the issue about the locale and the C locale that Prof Ripley mentioned. Where could I learn about that? In the R-admin manual (but Roger will understand). -- Brian D. Ripley, [EMAIL PROTECTED]

Re: [R] Box Tidwell / Error Message

2006-12-01 Thread John Fox
Dear Simon, It's hard to tell without the data and more information about the nature of the variables, but I suspect that the program is running into numerical difficulties because of a flat likelihood at the maximum. Is age2 by any chance age^2? How is year (in either form) related to age? I

Re: [R] C structures in R

2006-12-01 Thread Barry Rowlingson
Prof Brian Ripley wrote: The short answer is that quite a bit of code, e.g pwilcox and RODBC, does things like this. You don't need to pass the pointer back to R, but if you do external pointers are designed for this job. [reads a bit more of 'Writing R Extensions'...] Right yes,

[R] memeory problem?!

2006-12-01 Thread massimodisasha
hi, i'm trying to perform a clustering on a big dataframe the code is this: print(load required R packages) require(spgrass6) require(cluster) gmeta6 - gmeta6() print(read in our 7 raster files from GRASS) x - readFLOAT6sp(c (er,crosc,longc,slope,profc,minic,maxic)) print(assemble a

[R] group by

2006-12-01 Thread Hans-Juergen Eickelmann
Dear R-community, I started using R to control yield and output from different factories by production week. A typical example is below. LocationWeek ShippedWafer SortedWafer UnsortedWafer WaferYield GoodDie A 479 4 5 0.476 -12 B

Re: [R] lme function

2006-12-01 Thread Spencer Graves
RSiteSearch(lme spatial correlation, functions) produced 10 hits for me just now. The sixth title on that list was spatial correlation structure (http://finzi.psych.upenn.edu/R/library/nlme/html/corSpher.html). This is the help page for the corSpher function. The Examples section

[R] Make many barplot into one plot

2006-12-01 Thread Muhammad Subianto
Dear all, ## I have 4 tables like this: satu - array(c(5,15,20,68,29,54,84,119), dim=c(2,4), dimnames=list(c(Negative, Positive), c(Black, Brown, Red, Blond))) dua - array(c(50,105,30,8,29,25,84,9), dim=c(2,4), dimnames=list(c(Negative, Positive), c(Black,

Re: [R] simple parallel computing on single multicore machine

2006-12-01 Thread Greg Snow
Look at the nws package, I have had success using it to parallelize simulations using a couple of computers that were not being used at the time. I don't have a multicore machine, but the examples in the package make it look like using it for multicore would be even easier. This is on windows

Re: [R] Make many barplot into one plot

2006-12-01 Thread Marc Schwartz
On Fri, 2006-12-01 at 18:02 +0100, Muhammad Subianto wrote: Dear all, ## I have 4 tables like this: satu - array(c(5,15,20,68,29,54,84,119), dim=c(2,4), dimnames=list(c(Negative, Positive), c(Black, Brown, Red, Blond))) dua - array(c(50,105,30,8,29,25,84,9), dim=c(2,4),

Re: [R] group by

2006-12-01 Thread Alex Brown
Hi Hans, The short answer is yes. I suspect you need to look at the 'by', 'tapply' or 'aggregate' functions, depending upon what your data type is, exactly. In general, it's best to come up with a really simple example which illustrates the part you don't know how to do. If you can do

Re: [R] analog to the matlab buffer function?

2006-12-01 Thread Gregory R. Warnes
The gtools package also includes a function, 'running', which accomplishes the desired task: library(gtools) t(running(1:5, width=3, fun=c)) [,1] [,2] [,3] 1:3123 2:4234 3:5345 On 11/30/06 8:56 PM, Marc Schwartz [EMAIL PROTECTED] wrote: Here is

[R] error in hetcor function (polycor package)?

2006-12-01 Thread BRENDAN KLICK
I have been using the hetcor function in the polycor package. When I don't specify the use option everything runs smoothly. However, when I specify use either as pairwise.complete.obs or complete.obs I get this error Error in optim(rho, f, control = control, hessian = TRUE, method = BFGS) :

[R] error in hetcor function (polycor package)?

2006-12-01 Thread Klick, Brendan A.
I have been using the hetcor function in the polycor package. When I don't specify the use option everything runs smoothly. However, when I specify use either as pairwise.complete.obs or complete.obs I get this error Error in optim(rho, f, control = control, hessian = TRUE, method = BFGS) :

[R] error in hetcor function (polycor package)?

2006-12-01 Thread BRENDAN KLICK
I have been using the hetcor function in the polycor package. When I don't specify the use option everything runs smoothly. However, when I specify use either as pairwise.complete.obs or complete.obs I get this error Error in optim(rho, f, control = control, hessian = TRUE, method = BFGS) :

Re: [R] C structures in R

2006-12-01 Thread Martin Maechler
BaRow == Barry Rowlingson [EMAIL PROTECTED] on Fri, 01 Dec 2006 14:09:13 + writes: BaRow Prof Brian Ripley wrote: The short answer is that quite a bit of code, e.g pwilcox and RODBC, does things like this. You don't need to pass the pointer back to R, but if you do

Re: [R] 3D histogramm

2006-12-01 Thread Ben Bolker
Céline Henzelin celine_appui at hotmail.com writes: thank you for your answer i checked my code and it now works One more question... do you know how to have an 3D histogramm from a known matrix of probabilities Cline An RSiteSearch on 3d histogram will get you some answers, as

[R] combining bclust and kkmeans

2006-12-01 Thread Laurent Valdes
Hi, I have a very large dataset of 3008 individuals and 800 numerical variables. In fact it is a table of 3008 36-monthes multivariated time series that I would like to classify with an unsupervised algorithm I had a look at the function kkmeans of e1071 package, which seems to be a kernel

Re: [R] Make many barplot into one plot

2006-12-01 Thread Deepayan Sarkar
On 12/1/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Fri, 2006-12-01 at 18:02 +0100, Muhammad Subianto wrote: Dear all, ## I have 4 tables like this: satu - array(c(5,15,20,68,29,54,84,119), dim=c(2,4), dimnames=list(c(Negative, Positive), c(Black, Brown, Red,

[R] Demand of help

2006-12-01 Thread hassen62
Hi, I'm a phd student of economics in Tunisia who is intersted now with the seasonal unit roots test of Canova and Hansen. So I've installed the package uroot in RGUI. I use R 2.4.0. The problem when I apply the function to my data, I've always a message from RConsole that it is impossible to

Re: [R] Demand of help

2006-12-01 Thread Roger Bivand
On Fri, 1 Dec 2006 [EMAIL PROTECTED] wrote: Hi, I'm a phd student of economics in Tunisia who is intersted now with the seasonal unit roots test of Canova and Hansen. So I've installed the package uroot in RGUI. I use R 2.4.0. The problem when I apply the function to my data, I've always a

[R] memory problem

2006-12-01 Thread Massimo Di Stefano
hi to all, frustated for this error, to day i buy a 1 GB memory slot for my laptop now it have 1,28GB instead the old 512, but i've the same error :-( damn!damn!how can i do? repeat for a little area (about 20X20 km and res=20m) it work fine! have you any suggestion? is ther a method for look

[R] R News, volume 6, issue 5 is now available

2006-12-01 Thread p . murrell
Hi The December 2006 issue of R News is now available on CRAN under the Documentation/Newsletter link. Paul (on behalf of the R News Editorial Board) -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL

Re: [R] AIC for heckit

2006-12-01 Thread Brian Ripley
As I read it hectik() in micEcon does not fit by maximum likelihood, so AIC is undefined. (People seem to have a magic faith in AIC as a universal panacea, but it does come with a long list of conditions for applicability.) heckit's $probit is apparently only part of the fitting, but for any

[R] Confusing difference in S4 summary method dispatch within an S3 summary

2006-12-01 Thread Christopher N. Lawrence
I'm trying to track down a problem I'm having in the Zelig package and have stumbled across a very odd difference in the method dispatch for a derived S4 class. Specifically, I have an object of class ZeligS4vglm, which is a subclass of vglm and vlm respectively (these are from the VGAM package).

Re: [R] newbie: new_data_frame - selected set of rows

2006-12-01 Thread Darek Kedra
Two missing things: distances [1] 13 14 10 11 2 4 6 1 3 9 8 12 7 5 #numbers correspond to rows in my_dataframe my_dataframe V2 V3 V4 V5 V6 ENSP0354687 35660.45 0.04794521 0.05479452 0.06849315 0.07534247 ENSP0355046

Re: [R] error in hetcor function (polycor package)?

2006-12-01 Thread John Fox
Dear Brendan, That's curious, because the use argument to hetcor() works fine for me (see below). Is it possible that you tried to use this argument without specifying a data frame as the first argument to hetcor? If so, please see ?hetcor. If not, it would help to have an example. I hope this

[R] package installation fails only for sp

2006-12-01 Thread Don McKenzie
I have escaped Splus for Windows (mostly) and have started using R (v 2.3.1 on i686 redhat). Installing packages has been routine except for sp (classes and methods for spatial data). I get the following error message install.packages(sp) Warning in

Re: [R] error in hetcor function (polycor package)?

2006-12-01 Thread BRENDAN KLICK
Yes, that's it. hetcor(x1, x2, y1, y2) hetcor(data, use=pairwise.complete.obs) works but hetcor(x1, x2, y1, y2, use=complete.obs) hetcor(x1, x2, y1, y2, use=pairwise.complete.obs) do not. Thanks very much! Brendan John Fox [EMAIL PROTECTED] 12/01/06 6:19 PM Dear Brendan, That's

[R] cloud() question

2006-12-01 Thread Michelle DePrenger-Levin
Hello, I am trying to plot lines in 3 dimensions from a multiple linear model to illustrate the interaction of two of the explanatory variables. I'm trying to use the cloud function (though I'm open to a different function if an easier one exists). I keep getting the error message: Error in

Re: [R] cloud() question

2006-12-01 Thread Deepayan Sarkar
On 12/1/06, Michelle DePrenger-Levin [EMAIL PROTECTED] wrote: Hello, I am trying to plot lines in 3 dimensions from a multiple linear model to illustrate the interaction of two of the explanatory variables. I'm trying to use the cloud function (though I'm open to a different function if an

Re: [R] package installation fails only for sp

2006-12-01 Thread Peter Dalgaard
Don McKenzie wrote: I have escaped Splus for Windows (mostly) and have started using R (v 2.3.1 on i686 redhat). Installing packages has been routine except for sp (classes and methods for spatial data). I get the following error message install.packages(sp) Warning in

[R] fixup for debug package and R2.4.0

2006-12-01 Thread Mark.Bravington
A number of users have spotted a terminal problem with the 'debug' package under R2.4.0, along the lines of mtrace(x) x() Error in attr(value, row.names) - rlabs : row names must be 'character' or 'integer', not 'double' This arose from a bug in 'rbind.data.frame' in R2.4.0 itself. The bug

Re: [R] Quadratic Optimization

2006-12-01 Thread Spencer Graves
Unless I'm missing something, optimizing a linear function with quadratic constraints is almost trivial with Langrange multipliers. Maximize a'x subject to x'Ax=c. S = Lagrange objective = a'x+lam*(x'Ax-c). dS/dx = a + 2*lam*Ax. Given lam, x1 = solve(A,

[R] Is there a better way for inputing data manually?

2006-12-01 Thread Wei-Wei Guo
Dear All, I have worked with R for some time. It's a great tool for data analysis. But it's too hard to inputing raw data manually with R (I don't mean importing data. R is good at importing data). Maybe it's not a focused topic in this list, but I don't know other place where I can ask the

Re: [R] Is there a better way for inputing data manually?

2006-12-01 Thread Duncan Murdoch
On 12/1/2006 11:00 PM, Wei-Wei Guo wrote: Dear All, I have worked with R for some time. It's a great tool for data analysis. But it's too hard to inputing raw data manually with R (I don't mean importing data. R is good at importing data). Maybe it's not a focused topic in this list, but

Re: [R] package installation fails only for sp

2006-12-01 Thread Prof Brian Ripley
One thing you did miss was the request in the posting guide to update to the latest version of R before posting. Note that it is the download that fails, not the installation. There is a binary versioon of 'sp' for R 2.3.x on the CRAN master, so it looks like a problem with the CRAN mirror

Re: [R] package installation fails only for sp

2006-12-01 Thread Prof Brian Ripley
Sorry, I missed that 'i686 redhat' might mean Red Hat, that is a form of Linux. The advice in the first para applies: the current version of 'sp' in the source area on CRAN is for R=2.4.0: see http://cran.r-project.org/src/contrib/Descriptions/sp.html If you cannot update your R, there are