[R] Sweave figure aspect ratio

2007-09-09 Thread Werner Wernersen
Hello, using Sweave, is there any option to preserve the original aspect ratio of plots generated from R code? Consider this Sweave chunk: test,echo=F,fig=T,width=2,height=2= x - 1:10 y - sin(x) par(mar=c(4,4,0,4)) plot(x,y, xlab=x label, ylab=y label ) @ In Latex, I want to

Re: [R] Sweave figure aspect ratio

2007-09-09 Thread Werner Wernersen
--- Duncan Murdoch [EMAIL PROTECTED] schrieb: On 09/09/2007 7:24 AM, Werner Wernersen wrote: Hello, using Sweave, is there any option to preserve the original aspect ratio of plots generated from R code? Consider this Sweave chunk: test,echo=F,fig=T,width=2,height=2= x - 1:10 y - sin

Re: [R] capture.out(system())?

2007-09-06 Thread Werner Wernersen
Thank you very much, Professor Ripley! I am using Windows 2000 and the intern=T argument of system() did exactly what I needed: Now system() returns the output of the external program as an object. Thanks again, Werner --- Gustaf Rydevik [EMAIL PROTECTED] schrieb: On 9/4/07, Werner

[R] capture.out(system())?

2007-09-04 Thread Werner Wernersen
Hi, I am trying to capture the console output of program I call via system() but that always returns only character(0). For example: capture.output(system(pdflatex out.tex) ) will yield: character(0) and the output still written to the R console. Is there a command for intercepting this

Re: [R] Column naming mystery

2007-08-28 Thread Werner Wernersen
-Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Werner Wernersen Sendt: 27. august 2007 15:21 Til: r-help@stat.math.ethz.ch Emne: Re: [R] Column naming mystery Sorry that the problem description was not sufficient. Here is a self-contained

[R] Column naming mystery

2007-08-27 Thread Werner Wernersen
Hi, I hope somebody could help me explain what seems mysterious to me? I use this line on a dataframe ae: summaryBy(total_inflated+total~gr1, data=ae, FUN=sum, na.rm=T) and it returns 3 columns as expected and columns gr1 and total_inflated.sumare correct but the total.sum column consists of

Re: [R] Column naming mystery

2007-08-27 Thread Werner Wernersen
Sorry that the problem description was not sufficient. Here is a self-contained code replicating the problem: require(doBy) x - as.data.frame(matrix(ncol=3,seq(1,12),dimnames=list(c(),c(hh,total,total.inf summaryBy(total+total.inf~hh,x,FUN=sum) What surprises me are the zeros in the

[R] How to make an array of data.frames?

2007-08-26 Thread Werner Wernersen
Hi, I am still struggling with the data structures in R. I know how it works in C++ but how can I get such a structure in R? Here is what I want: x[a]$dataframe1 x[a]$dataframe2 x[a]$dataframe3 x[b]$dataframe1 x[b]$dataframe2 x[b]$dataframe3 x[c]$dataframe1 x[c]$dataframe2 x[c]$dataframe3 And

[R] Sweave and TexnicCenter

2007-08-24 Thread Werner Wernersen
Hi, I started using Sweave and it's really great. I have only a minor problem: Is anybody using Sweave together with TexnicCenter and has found out how to get the syntax coloring right? After a $ in the code chunk the coloring stays in math mode. Thanks and kind regards, Werner

[R] Processing Sweave documents without Sweave

2007-08-22 Thread Werner Wernersen
Hi, I am very intrigued by the idea of integrating statistical analysis directly with a paper as Sweave does it. But as I am collaborating with several people and they won't have set up R and also they're very unlikely interested in learning it, I am concerned about how such an Latex/Sweave

Re: [R] Processing Sweave documents without Sweave

2007-08-22 Thread Werner Wernersen
the TeX code. Best, Renaud 2007/8/22, Werner Wernersen [EMAIL PROTECTED]: Hi, I am very intrigued by the idea of integrating statistical analysis directly with a paper as Sweave does it. But as I am collaborating with several people and they won't have set up R and also

[R] Problem mit summaryBy: Group sums gives me incorrectly zero for one variable

2007-08-20 Thread Werner Wernersen
Hi, first I want to thank all of you for the quick aid which is provided here on the list during all times. Thanks a lot for that! Then, I have a problem using summaryBy which most probably is a problem of wrong use by me or the like: I use this command: summaryBy(total+total.inf~gr, aE,

Re: [R] Problem mit summaryBy: Group sums gives me incorrectly zero for one variable

2007-08-20 Thread Werner Wernersen
Just an additional note: It must be a problem with the variable names. If I change total.inf to for instance ttotal.inf then it works as expected. What is the rule here? I would like to avoid such problems in the future. Thanks, Werner Hi, first I want to thank all of you for the quick

[R] svyglm.predict: cannot allocate vector

2007-08-17 Thread Werner Wernersen
Hi, I have a problem with the predict function of svyglm: When I try to predict with an object of svyglm I get the error message that R can't allocate a vector about 3 GB big. Has anybody a hint how I can reduce the memory used for this? I have about 25000 observation and use the weigths

[R] Function for reading in multidimensional tables / data.frames

2007-08-15 Thread Werner Wernersen
Hi, I was wondering if there is already some function implemented into R that reads in tables with more than 2 dimensions. There is probably something neat out there... Thanks, Werner Wissenswertes zum Thema PC, Zubehör oder Programme. BE A BETTER INTERNET-GURU! www.yahoo.de/clever

Re: [R] Function for reading in multidimensional tables / data.frames

2007-08-15 Thread Werner Wernersen
Never mind, using scan() and putting it into an array of the specific dimensions is sufficient for my case. But it still would be interesting to know if there is some function to read in more complex data objects. Thanks, Werner Hi, I was wondering if there is already some function

[R] using sampling weights in glm

2007-08-15 Thread Werner Wernersen
Hi, I have a supposedly representative sample from a stratified survey. Hence, all observations have an associated sample weight each which inflate the sample to population size. I want to run a glm probit regression on the data but I am not clear about if or better how I can use the weights in

[R] Modifying Regression Coefficients

2007-07-16 Thread Werner Wernersen
Hi, This is probably trivial but I haven't discovered how it works: I have estimated a regression model using glm() and now I want to modify a coefficient of that model and use the model object for predictions. How can I modify such a coefficient? Many thanks, Werner

[R] viewing source code

2007-06-18 Thread Werner Wernersen
Hi, could somebody give me a quick hint how to view the source code of a function if sole entering of the function name does not work? In particular, I am trying to look at cd_plot from the vcd package. Many thanks in advance, Werner __

Re: [R] AIC for heckit

2006-12-06 Thread Werner Wernersen
Thanks for the hint, Jay! But somehow it seems like the included $probit object is not of class glm and I couldn't find an AIC property on it. I tried it your way. Any other suggestions regarding how I can evaluate the fit of the first-step selection model included in heckit()? Best, Werner

[R] summaryBy(): Is it the best option?

2006-12-04 Thread Werner Wernersen
Hi, since I have quite large tables and the processing takes quite a while I am curious if I can improve the performance of this aggregation somehow: At the moment I am using summaryBy from the doBy package under R 2.4.0, Win2K. summaryBy(soc_s6aq5 + soc_s6aq7 + soc_s6aq9 + soc_s6aq11 ~ hh +

[R] AIC for heckit

2006-11-30 Thread Werner Wernersen
Hi, I have used the heckit function in micEcon. Now I would like to evaluate the fit of the probit part of the model but when I enter AIC(sk$probit) I get this error Error in logLik(object) : no applicable method for logLik How can I then get the AIC for this model? Side question: If you know

[R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
Hi, I have a list with the names of tables, e.g. l - c(t1,t2,t3) and I want to change the colnames of each of the tables in a for loop like this: for (x in l) { colnames(eval(x)) - lower.case(colnames(eval(x))) } This does not work but could someone give me some help to get on the right

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
)) - lower.case(colnames(get(x))) b On Nov 16, 2006, at 9:01 AM, Werner Wernersen wrote: Hi, I have a list with the names of tables, e.g. l - c(t1,t2,t3) and I want to change the colnames of each of the tables in a for loop like this: for (x in l) { colnames(eval(x

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
- Original Message - From: Werner Wernersen [EMAIL PROTECTED] To: Benilton Carvalho [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Thursday, November 16, 2006 4:06 PM Subject: Re: [R] modifying colnames of tables in a loop That's almost perfect! Only the operation colnames

Re: [R] Can I set the proxy server and authentification from within R?

2006-11-09 Thread Werner Wernersen
Thanks a lot for your help! One more remark if somebody runs into the same problem: The .Renviron file has to be in the correct directory. It can be checked with Sys.getenv('http_proxy') that the settings have been actually read in. The .Renviron file looks like this now:

[R] Can I set the proxy server and authentification from within R?

2006-11-08 Thread Werner Wernersen
Hi, I am using Tinn-R and somehow I cannot point it to start a R shortcut with http_proxy settings including authentification. It always shows the .exe. Is there any way to set the proxy from within R or any other ideas how to do it? I am using R 2.4 for Windows. Thanks a million, Werner

[R] GHK Simulator for Ordered Probit

2006-10-19 Thread Werner Wernersen
Hi, I am wondering if anybody has already written a GHK Simulator function for an ordered probit model in R? We have a system of three equations where the variables can take ordered categorial values. Thanks a million, Pensi __

Re: [R] Engel curve

2006-05-17 Thread Werner Wernersen
]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On May 16, 2006, at 10:24 AM, Werner Wernersen wrote: Hi, has anybody an example of an Engel curve analysis in R or does

[R] Engel curve

2006-05-16 Thread Werner Wernersen
Hi, has anybody an example of an Engel curve analysis in R or does there exist a package to estimate and plot Engel curves from expenditure / income data in R? Thanks a million for your hints, Werner __ R-help@stat.math.ethz.ch mailing list

Re: [R] optimal way to compute matrix subtotals?

2006-05-14 Thread Werner Wernersen
Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Werner Wernersen To: Sent: Friday, May 12

[R] optimal way to compute matrix subtotals?

2006-05-12 Thread Werner Wernersen
Hi! I have large matrices, one column per variable and I have a vector of factors / grouping symbols. Then I am computing subtotals for the groups but it takes pretty long and thus I wanted to ask if there is a better way to do it or if this is already the best way: subTotals - function(x,

[R] Considering port of SAS application to R

2006-04-21 Thread Werner Wernersen
Hi there! I am considering to port a SAS application to R and I would like to hear your opinion if you think this is possible and worthwhile. SAS is mainly used to do data management and then to do some aggregations and simple computations on the data and to output a modified data set. The

Re: [R] Considering port of SAS application to R

2006-04-21 Thread Werner Wernersen
STEP looping features you might be forced to look into SQL cursors, otherwise the port should be (very) straightforward. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Werner Wernersen Sent: Friday, April 21, 2006 7:09 AM To: r-help@stat.math.ethz.ch

[R] List to Array

2006-04-05 Thread Werner Wernersen
Hi, this is probably the easiest thing to do but I manage not finding the answer: I have a list with matrices of exact same format and headers. Now I would like to transform the list into an normal array. What is the proper way to do this? as.array changes the entire format and right now I only

Re: [R] List to Array

2006-04-05 Thread Werner Wernersen
] [,2] [1,]14 [2,]25 [3,]36 , , 2 [,1] [,2] [1,]14 [2,]25 [3,]36 Please supply some test data and the expected answer since its not clear what is desired here. On 4/5/06, Werner Wernersen [EMAIL PROTECTED] wrote: Hi, this is probably

Re: [R] List to Array

2006-04-05 Thread Werner Wernersen
/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Werner Wernersen [EMAIL PROTECTED] To: Gabor Grothendieck [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent

[R] determine dimension on which by() applies

2006-04-05 Thread Werner Wernersen
Hi, having solved one problem with your kindest help I directly ran into the next one: I now have a 4-dimensional array and I want to aggregate subsets (sum up over) for some of the dimensions. This sort of aggregating works beautifully for matrices with by(). Is there a similar function where I

[R] How to set a former environment?

2006-04-03 Thread Werner Wernersen
Hi, I probably misunderstand the entire concept of environments in R. I now have a list of environments in which each has a number of variables. What I want to do is to apply a function on each of those environments which adds additional variables to that particular environment. Is there a way to

Re: [R] Problem with help() respectively ?

2006-04-01 Thread Werner Wernersen
Hi, I have a problem with my the R help system. I have been searching through the help archives but I can't find anything about it and I don't know how to specify my search better. When I type for instance ?hist, just the next command line prompt shows but nothing actually

[R] Sourcing data files into different array fields

2006-04-01 Thread Werner Wernersen
Hi, I make a number of experiments with a software which spits out one .R file of data objects to be sourced for each experiment. Now, the files repeat the data object names but ultimately I also want to perform comparision statistics between several objects. Now my question is, is there a

[R] Problem with help() respectively ?

2006-03-31 Thread Werner Wernersen
Hi, I have a problem with my the R help system. I have been searching through the help archives but I can't find anything about it and I don't know how to specify my search better. When I type for instance ?hist, just the next command line prompt shows but nothing actually happens. There is no

[R] reading in multi-dimensional data from .csv

2006-03-27 Thread Werner Wernersen
Hi, I would like to read in multi-dimensional data from a text file, i.e. tables with more than 2 dimensions. I have looked for a function which I can abuse for that but haven't found anything. I would appreciate it a lot if somebody gave me a hint if such functions already exist somewhere.

[R] GTAP analysis

2006-03-16 Thread Werner Wernersen
Hi, did anybody come across packages or scripts for reading in and analysing GTAP / GEMPACK data and results? If so give me a hint, please! Thanks, Werner __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Accessing row names

2006-02-03 Thread Werner Wernersen
Hi, I am doing cluster analysis and get back the vector with the clusters. Now I want to access the original data according to the assigned clusters. Therefore, I need the row names of the $cluster vector. Right now I do the following what works but seems a little awkward:

[R] cluster plot for cmeans cluster result

2006-01-23 Thread Werner Wernersen
Hi, I am trying to make a plot similar to figure 2 on page 318 of the finding groups in data book by kaufman / rousseeuw. I found plot.partition and clusplot but I don't get them to work from the results returned from a cmeans() clustering. How do I have to transform the

[R] Vector indices

2006-01-17 Thread Werner Wernersen
Hi, I am despairing of getting the indices for a vector: First, I have a table from which I kick out a number of rows with na.omit. Next, I use this table for clustering with kmeans and cl$cluster contains my clusters. The cl$cluster is a vector which still contains my original indices

Re: [R] R-help Digest, Vol 35, Issue 14

2006-01-14 Thread Werner Wernersen
Dear all, Is anybody aware of a tutorial, introduction, overview or alike for cluster analysis with R? I have been searching for something like that but it seems there are only a few rather specialized articles around. I would very much appreciate any hint. Thanks a million, Werner

[R] matching country name tables from different sources

2006-01-10 Thread Werner Wernersen
Hi, Before I reinvent the wheel I wanted to kindly ask you for your opinion if there is a simple way to do it. I want to merge a larger number of tables from different data sources in R and the matching criterium are country names. The tables are of different size and sometimes the

Re: [R] matching country name tables from different sources

2006-01-10 Thread Werner Wernersen
- matrix(, nrow=an, ncol=bn) for (i in 2:an) for (j in 2:bn) m[i,j] - if (substr(a,i-1,i-1)==substr(b,j-1,j-1)) paste(m[i-1,j-1], substr(a,i-1,i-1), sep = ) else longest(m[i-1,j], m[i,j-1]) # Returns the distance m[an,bn] } On 1/10/06, Werner Wernersen

[R] Using R map data to determine associated state for a coordinate?

2005-09-08 Thread Werner Wernersen
Hi! I have no idea if this is maybe an easy task utilizing R since I read there is geographical map data in some package: I have a huge number of geographical points with their coordinates in Germany. Now I want to determine for each point in which Bundesland = state it is located. Can

[R] delete -character from strings in matrix

2005-06-12 Thread Werner Wernersen
Hi! I have strings where occasionally some -chars occur. How can I delete these chars? I tried it with gsub but using as replace does not work. Thanks a lot for any hint! Regards, Werner __ R-help@stat.math.ethz.ch mailing list

Re: [R] delete -character from strings in matrix

2005-06-12 Thread Werner Wernersen
,] a c [2,] b d R-2.1.0 on WinXPPro. Andy From: Werner Wernersen Hi! I have strings where occasionally some -chars occur. How can I delete these chars? I tried it with gsub but using as replace does not work. Thanks a lot for any hint! Regards, Werner

[R] Advice on Speed Improvement

2005-04-24 Thread Werner Wernersen
Hi folks! Somehow I still write crappy code which is awefully slow. Maybe as a case study, could anybody give me a hint on how to improve the following code for speed? d is a 360x500 matrix. Basically, each group of 5 columns represent a run. For each run I aggregate some columns, find which

Re: [R] Label / Tick under single Boxplot

2005-04-20 Thread Werner Wernersen
Hi! I am trying to get the tick / label under a stacked boxplot with only a single data row. With =2 rows it works, but with a single one the tick resp. my class name is not printed below the boxplot. Can anybody point me to what am I doing wrong? For example:

[R] Label / Tick under single Boxplot

2005-04-19 Thread Werner Wernersen
Hi! I am trying to get the tick / label under a stacked boxplot with only a single data row. With =2 rows it works, but with a single one the tick resp. my class name is not printed below the boxplot. Can anybody point me to what am I doing wrong? For example:

[R] Barplot and colors for legend

2005-04-18 Thread Werner Wernersen
Hi all! One quick question: How do I get the standard colors used by barplot? I have some stacked bars and would like to add a horizontal legend via legend() but I don't know how to find the colors for the fills of the legend points. Thanks! Werner

[R] array indexing and which

2005-04-17 Thread Werner Wernersen
Hi R friends! I am stuck with a stupid question: I can circumvent it but I would like to understand why it is wrong. It would be nice if you could give me a hint... I have an 2D array d and do the following: ids - which(d[,1]0) then I have a vector gk with same column size as d and do: ids2 -

Re: [R] replace values in a matrix subject to boolean condition

2005-03-24 Thread Werner Wernersen
Uwe Ligges wrote: Werner Wernersen wrote: Hi everybody! I am sorry to bother you with a question so simple but I think there might be a better solution: I have a matrix of size 360x501 where I want to check the value of each 5th column of each row and replace it (and the 6th, 7th, 8th

[R] replace values in a matrix subject to boolean condition

2005-03-23 Thread Werner Wernersen
Hi everybody! I am sorry to bother you with a question so simple but I think there might be a better solution: I have a matrix of size 360x501 where I want to check the value of each 5th column of each row and replace it (and the 6th, 7th, 8th column) by zero if the value is less than 1000. I

[R] Multiple histograms in one chart

2005-03-12 Thread Werner Wernersen
Hi! I've searched quite a while and this is probably a very easy question: How do I prevent a new hist() histogram from clearing the chart window before drawing? I would like to have several histograms simply drawn on each other in one chart... Thanks for your help! Werner In use: win2ksp4

[R] R Site Search Firefox Plugin

2005-03-03 Thread Werner Wernersen
Hi! I have made a simple plugin for the Firefox search bar which searches via R Site Search. I submitted it weeks ago to Mozilla.org but they don't seem to respond. Thus, if anybody is interested, please let me know. Maybe we could also find some space on a ftp server for it. Best, Werner

[R] Re: R Site Search Firefox Plugin

2005-03-03 Thread Werner Wernersen
Hi again! someone has kindly provided webspace for the R Site Search plugin. You'll find it here: http://www.xyzump.de/rsitesearch.zip Just extract the files to the \Mozilla Firefox\searchplugins\ directory and restart Firefox. Best, Werner __

[R] German Map Data?

2005-03-03 Thread Werner Wernersen
Hello! Is there a more accurate map of germany than the one included in the world map of the map package available? I am using R 2.0.1 under win2k. Thanks, Werner __ R-help@stat.math.ethz.ch mailing list

Re: [R] Journal Quality R Graphs?

2005-03-02 Thread Werner Wernersen
on the same printer or tried different printers for the same R graph. This will hopefully eliminate printer as a possible culprit. Dying printer toners sometimes makes the graph look worse than it actually is. Regards, Adai On Tue, 2005-03-01 at 00:27 +0100, Werner Wernersen

Re: [R] Journal Quality R Graphs?

2005-03-02 Thread Werner Wernersen
on the same printer or tried different printers for the same R graph. This will hopefully eliminate printer as a possible culprit. Dying printer toners sometimes makes the graph look worse than it actually is. Regards, Adai On Tue, 2005-03-01 at 00:27 +0100, Werner Wernersen wrote

[R] Journal Quality R Graphs?

2005-02-28 Thread Werner Wernersen
Hi! I have browsed the help archives but did not find anything on the subject: How to make publication quality graphs with R best? Is there some document about that topic out there? The problem is that the graphs look nice on the screen but when printed in black and white every color apart

[R] Easy cut paste from Excel to R?

2005-02-16 Thread Werner Wernersen
Hi! Is it possible to easily cut paste data from an Excel spreadsheet to an R edit( ) grid or to variable? It seems that R cannot handle the cell delimiters Excel hands over. Regards, Werner __ R-help@stat.math.ethz.ch mailing list

Re: [R] Easy cut paste from Excel to R?

2005-02-16 Thread Werner Wernersen
Thank you all very much for the answers! The read.table / read.delim2 commands are exactly what I was looking for to get a couple of numbers or a little matrix quickly into R without creating an extra text file every time. And it works the other way around as well: write.table(x,

Re: [R] Bubble Plot with Pie Charts

2005-02-13 Thread Werner Wernersen
OK, I used the paper Integrating grid Graphics Output with Base Graphics Output by Paul Murrell (R News) which has an example of implementing pie maps and made up a function from that. It looks actually very nice! One thing I couldn't figure out is if I can make pie charts transparent, so that

[R] Transparent Pie Charts

2005-02-13 Thread Werner Wernersen
Hi again! I put this question in another topics post before but I fear it might drown there. Is it possible to have transparent / alpha blended colors for pie charts? I am using the pies in a map of pies and those pies are sometimes overlapping so it would be great to see if another pie lies