Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread Werner Wernersen
Hi, I have to follow up my own question since this problem is getting quite disturbing and I fear that it also causes other functions to malfunction without notice. It occurs quite quite often when I manipulate the mentioned data set. It definitely is caused by the column entries which are

[R] weird vector size cannot be NA/NaN problem

2009-09-09 Thread Werner Wernersen
Hi, I have a weird problem with my data but I cannot really locate it and cannot make a small example data set do reproduce the problem. I basically divide one numerical column of a data frame with another. When I run describe() on that column, I get Error in vector(integer, length) : vector

[R] Changing font to times for EMF graphics

2009-09-08 Thread Werner Wernersen
Hi, sorry for the simple question. I am usually able to change the font for PDF graphics with pdf.options(family=Times) However, I have found no way yet to get an emf file with a times font. I also tried a detour by using pstoedit to convert a pdf with the desired font to an emf but even there

[R] solving system of equations involving non-linearities

2009-08-06 Thread Werner Wernersen
Hi, I would appreciate if someone could help me on track with this problem. I want to compute some parameters from a system of equations given a number of sample observations. The system looks like this: sum_i( A+b_i0 A+b_iC+d_i) = x sum_i( C+d_i0 C+d_iA+b_i) = y sum_i( exp(E+f_i) * ( A+b_i0

Re: [R] Insignificant variable improves AIC (multinom)?

2009-06-13 Thread Werner Wernersen
Hi, I am trying to specify a multinomial logit model using the multinom function from the nnet package. Now I add another independent variable and it halves the AIC as given by summary(multinom()). But when I call Anova(multinom()) from the car package, it tells me that this added

[R] Insignificant variable improves AIC (multinom)?

2009-06-12 Thread Werner Wernersen
Hi, I am trying to specify a multinomial logit model using the multinom function from the nnet package. Now I add another independent variable and it halves the AIC as given by summary(multinom()). But when I call Anova(multinom()) from the car package, it tells me that this added variable is

[R] portable R editor

2009-03-02 Thread Werner Wernersen
Hi, I have been dreaming about a complete R environment on my USB stick for a long time. Now I finally want to realize it but what I am missing is a good, portable editor for R which has tabs and syntax highlighting, can execute code, has bookmarks and a little project file management

[R] Set of standard city size symbols as known from atlases?

2008-11-20 Thread Werner Wernersen
Hi, I am wondering exists a standard set of symbols to mark cities of different size classes on a map for R yet? In a standard atlas there are symbols like small filled circles, small filled circles with an outer circle, same with small squares, etc. which mark capitals and different size

[R] R system on USB: how to enter relative R environment path in Eclipse/StatET?

2008-11-14 Thread Werner Wernersen
Hi, I am trying to set up a portable R environment and wanted to use Eclipse and StatET as the editor. But when setting the R environment in StatET I cannot figure out how to enter a relative path. Has anybody succeeded in doing this? (eclipse and R are both in the common directory \programs on

[R] Methods for showing statistics over space

2008-10-25 Thread Werner Wernersen
Hi, I have a question which is a little off-topic but then again, it should stay in the boundaries of what can be done with available R functions. Has anyone pointers to tutorials or the like where one can get inspiration on how to visualize some spatial statistics? I want to analyze different

[R] retrieving matrix elements by giving pairs of row AND column numbers?

2008-10-22 Thread Werner Wernersen
Hi, this is probably a very trivial question but I can't figure out the right terms to find the solution in the list archive. I have a matrix or a data.frame or the like: m - matrix(ncol=3,seq(1,9)) m [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 and now I

Re: [R] retrieving matrix elements by giving pairs of row AND column numbers?

2008-10-22 Thread Werner Wernersen
I thought I've tried this already and that it doesn't work -- madness. Anyway, Jeff kindly sent me the solution: m[cbind(c(1,2,3),c(1,3,1))] does the trick. Thanks, Werner Hi, this is probably a very trivial question but I can't figure out the right terms to find the solution in the

Re: [R] retrieving matrix elements by giving pairs of row AND column numbers?

2008-10-22 Thread Werner Wernersen
] An: Werner Wernersen [EMAIL PROTECTED]; [EMAIL PROTECTED] [EMAIL PROTECTED] Gesendet: Mittwoch, den 22. Oktober 2008, 19:37:28 Uhr Betreff: RE: [R] retrieving matrix elements by giving pairs of row AND column numbers? Subscript using a 2 column matrix with the rows in the first column

[R] factors in dynlm?

2008-10-18 Thread Werner Wernersen
Hello, how can one use factors in dynlm? I would like to add month dummies to the equation. Or is creating 12 vectors the way to do it? Thanks a lot, Werner einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com

[R] dynlm and lm: should they give same estimates?

2008-10-15 Thread Werner Wernersen
Hi, I was wondering why the results from lm and dynlm are not the same for what I think is the same model. I have just modified example 4.2 from the Pfaff book, please see below for the code and results. Can anyone tell my what I am doing wrongly? Many thanks, Werner set.seed(123456) e1 -

[R] map + some arbitrary locations' heights: some kind of perspective or contour plot possible?

2008-10-10 Thread Werner Wernersen
Hi, I thought about this but programming it seems rather difficult so I was wondering if a function exists for this in R (as most of the times it turns out that it does): I have a map (shapefile) and for about 50 points on that map (GPS locations) I have heights. Is there a function which can

[R] syntax to restrict coefficient in lm()

2008-10-04 Thread Werner Wernersen
Hi, I would like to estimate an error correction model with lm() but I don't find the correct syntax for that. The model (leaving out the time indices) looks like: dY = a0 - a1 * (Y - b1*X) + b0*dX + e the problem is the term - a1 * (Y - b1*X). How can I restrict a1 to be the same for both Y

[R] R2HTML: output from for-loops

2008-09-23 Thread Werner Wernersen
Hi, I am trying to prepare a report with R2HTML using HTMLStart(outdir=./html, filename=report, echo=T, HTMLframe=F) then, for instance, I want to get the output of a loop: for (i in 1:20) print(summary(rnorm(1000))) but only the first of summaries really ends up in the html file. What am I

[R] R2HTML, HTMLStart(): are plots send to HTML?

2008-09-18 Thread Werner Wernersen
Hi, I just want to make sure that I really misunderstood the documentation: Is HTMLStart redirecting plots as well so that they are included in the HTML report? I tried the below and the plot is not included in the HTML file. Or did I miss some switch or so? Many thanks, Werner

[R] String search: Return closest match

2008-08-26 Thread Werner Wernersen
Hi, I have to match names where names can be recorded with errors or additions. Now I am searching for a string search function which returns always the closest match. E.g. searching for Washington it should return only Washington but not Washington, D.C. But it also could be that the list

Re: [R] String search: Return closest match

2008-08-26 Thread Werner Wernersen
That works perfectly, great. Thanks a lot for that Richard! Werner - Ursprüngliche Mail Von: [EMAIL PROTECTED] [EMAIL PROTECTED] An: Werner Wernersen [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; [EMAIL PROTECTED] Gesendet: Dienstag, den 26. August 2008, 14:10:11 Uhr Betreff: Re: [R

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-20 Thread Werner Wernersen
] An: Werner Wernersen [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Gesendet: Mittwoch, den 20. August 2008, 03:08:48 Uhr Betreff: Re: converting coordinates from utm to longitude / latitude Werner Wernersen wrote: It would be nicer to convert directly the entire shapefile object to long/lat coordinates

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-20 Thread Werner Wernersen
much Dylan! Werner - Ursprüngliche Mail Von: Dylan Beaudette [EMAIL PROTECTED] An: r-help@r-project.org CC: Werner Wernersen [EMAIL PROTECTED] Gesendet: Dienstag, den 19. August 2008, 23:29:34 Uhr Betreff: Re: [R] converting coordinates from utm to longitude / latitude If you would

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-20 Thread Werner Wernersen
Beaudette [EMAIL PROTECTED] An: r-help@r-project.org CC: Werner Wernersen [EMAIL PROTECTED] Gesendet: Dienstag, den 19. August 2008, 23:29:34 Uhr Betreff: Re: [R] converting coordinates from utm to longitude / latitude If you would like to convert the entire shapfile check out GDAL: http

[R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Werner Wernersen
Hi, is there a function in R to convert data read with read.shape and which is originally in UTM coordinates into longitude / latitude coordinates? I found the convUL() function from the PBSmapping package but I have no idea how I could apply that to the read.shape object. Many thanks,

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Werner Wernersen
, Werner - Ursprüngliche Mail Von: Werner Wernersen [EMAIL PROTECTED] An: [EMAIL PROTECTED] Gesendet: Dienstag, den 19. August 2008, 20:28:29 Uhr Betreff: converting coordinates from utm to longitude / latitude Hi, is there a function in R to convert data read with read.shape

[R] Threshold vector error correction models

2008-08-12 Thread Werner Wernersen
Hi, is anyone aware of estimation functions for threshold vector error correction / threshold cointegration models? I didn't find anything for R using RSeek or Google. Thanks a lot for any pointers, Werner __ Do You Yahoo!? hutz gegen

[R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Werner Wernersen
Hi, I was wondering if anybody might have a reference for me: My R code is growing and getting more and more confusing. Thus, I figure it's time to switch to object-oriented again. I have done oo programming in C++ and Java before but the first few tutorial on R oo were a bit confusing for me.

[R] RExcel - foreground server

2008-05-19 Thread Werner Wernersen
Hi, I have a problem using RExcel with a foreground server: in RExcel menu as well as in the window called by set server the foreground server option is grayed out. I have installed the rcom package and also tried to open R and type require(rcom), as explained on

Re: [R] Set of well distinguishable line types?

2008-04-29 Thread Werner Wernersen
: Werner Wernersen wrote: Hi, I am plotting several lines into one plot and would like them to be distinguishable in print later on as well. Thus, my question is: Is there a larger set of such line types available like the sets available for colors? Maybe somebody has already put

[R] Set of well distinguishable line types?

2008-04-28 Thread Werner Wernersen
Hi, I am plotting several lines into one plot and would like them to be distinguishable in print later on as well. Thus, my question is: Is there a larger set of such line types available like the sets available for colors? Maybe somebody has already put in the work to define some additional

Re: [R] Sweave - print \n ?

2008-03-29 Thread Werner Wernersen
of these documents. Werner Wernersen wrote: Hi, this is probably quite stupid but I have no clue what's wrong. Let's say I write the function hline - function() { cat(\\hline \n) } and call hline

[R] Sweave - print \n ?

2008-03-28 Thread Werner Wernersen
Hi, this is probably quite stupid but I have no clue what's wrong. Let's say I write the function hline - function() { cat(\\hline \n) } and call hline() from within a Sweave chunk. Why is there no carriage return after the \hline in the resulting tex file? if I call hline() hline() in the

[R] Sweave does not parse \Sexpr{}

2008-03-19 Thread Werner Wernersen
Hi, has anybody encountered and solved the following problem? I continued work now on a different computer where I have also used Sweave successfully before. I can run Sweave() and it generates a .tex file. All code chunks are processed and translated to Latex perfectly fine but somehow only the

Re: [R] Sweave does not parse \Sexpr{}

2008-03-19 Thread Werner Wernersen
grDevices datasets tcltk utils methods base other attached packages: [1] svSocket_0.9-5 svIO_0.9-5 R2HTML_1.58 svMisc_0.9-5 svIDE_0.9-5 loaded via a namespace (and not attached): [1] tools_2.6.2 Thanks, Werner --- Duncan Murdoch [EMAIL PROTECTED] schrieb: Werner

Re: [R] Sweave does not parse \Sexpr{}

2008-03-19 Thread Werner Wernersen
used R2HTML lately? If so, please see the Sweave FAQ http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html#x1-18000A.16 Max On Wed, Mar 19, 2008 at 7:15 AM, Werner Wernersen [EMAIL PROTECTED] wrote: Sorry about the lack of detail. Some facts: - code chunks are processed fine

[R] glm.fit: fitted probabilities numerically 0 or 1 occurred

2008-03-11 Thread Werner Wernersen
Hi, could anyone explain to me what this warning message exactly means and what the consequences are? Is it due to the fact that there are very extreme observations / outliers included or what is the reason for it? Thanks so much, Werner Machen Sie Yahoo! zu Ihrer Startseite. Los

[R] rrp.impute: for what sizes does it work?

2008-03-05 Thread Werner Wernersen
Hi, I have a survey dataset of about 2 observations where for 2 factor variables I have about 200 missing values each. I want to impute these using 10 possibly explanatory variables which are a mixture of integers and factors. Since I was quite intrigued by the concept of rrp I wanted to use

Re: [R] rrp.impute: for what sizes does it work?

2008-03-05 Thread Werner Wernersen
rrp is working! Sorry, it was my mistake... fiddling around to find out what the problem is I forgot to re-include the variables which are to be imputed. It seems like this case is not caught but the algorithm finishes with the mentioned error. Anyway, I am still a little fuzzy about imputation

Re: [R] column name handling and long labels

2008-02-27 Thread Werner Wernersen
Somehow, I don't get how the labels of Hmisc work. My expectation was that if I use the following code and then the print method, I would get an output where the headers are replaced by the labels but I get the normal variable names. How can I get the labels as headers instead in the printed

Re: [R] Custom LaTeX tables

2008-02-27 Thread Werner Wernersen
Thanks for the answers! I will play around a bit and maybe I really need to write a custom wrapper than. Best, Werner --- Gabor Grothendieck [EMAIL PROTECTED] schrieb: On Tue, Feb 26, 2008 at 10:58 AM, Werner Wernersen [EMAIL PROTECTED] wrote: Hello, I am very happy that I have Sweave

[R] Custom LaTeX tables

2008-02-26 Thread Werner Wernersen
Hello, I am very happy that I have Sweave and R to write my papers. But I still have to do some tables by hand since I have not found out how I can customize the latex tables produced by R further (I mainly use xtable()). Like for instance, I have a table which needs an extra row every few rows

[R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
Hi, I have two loosely related questions which could make my live again a bit easier: 1) Is there a simple way to select a range of columns in a data frame using column names? I am thinking of something like mydf[1,col4:col8] 2) I have a data frame with many columns and they all have short

Re: [R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
Thank you very much, Henrique! The comment function is exactly what I was looking for. Regarding 1) why example was bad: The column names don't follow an easy pattern but are more like s8v2, s12v3, s6v1 etc. Kind regards, Werner --- Henrique Dallazuanna [EMAIL PROTECTED] schrieb: Try

Re: [R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
That's perfect! The subset way is very easy to use and I have to play around a bit more with label() which seems quite complex. Thanks a million, Werner --- Gabor Grothendieck [EMAIL PROTECTED] schrieb: On Thu, Feb 21, 2008 at 6:09 AM, Werner Wernersen [EMAIL PROTECTED] wrote: Hi, I

[R] Connecting from Excel to running R session?

2008-01-30 Thread Werner Wernersen
Hi, I haven't used RExcel before but from what I've read in the instructions so far it seems like I cannot connect from RExcel to an already running R session, can I? The background is that usually I use Tinn-R and start R from there but occasionally I get the sudden desire to push the data to

[R] sqldf error

2008-01-29 Thread Werner Wernersen
Hi, sqldf sounds like a very useful package but I don't even get the example to run: a1s - sqldf(select * from warpbreaks limit 6) Error in combine(FUN(...)) : argument value is missing, with no default I am using R 2.6.1 on Windows Vista Business and have updated all packages. Some

Re: [R] sqldf error

2008-01-29 Thread Werner Wernersen
(...command...) 2. Try issuing the source statement in example 6 on the sqldf home page first (that will get you the development version) and try that. I doubt that will solve it but its worth a try. http://sqldf.googlecode.com On Jan 29, 2008 5:58 AM, Werner Wernersen [EMAIL PROTECTED

[R] micEcon: selection(,method=ml) . Predict method?

2007-09-19 Thread Werner Wernersen
Hi, as I read, maximum likelihood is the better method for estimating selection-biased models. But I also want to predict from that model. Is there any predict method for the selection function when using maximum likelihood estimation in micEcon? I couldn't find any. Many thanks, Werner

[R] Linear model with svyglm

2007-09-18 Thread Werner Wernersen
Hi, I am a bit unclear if svyglm with family=gaussian is actually a normal linear model including weighting. The goal is to estimate a normal linear model using sample inflation weights. Can anybody illuminate me a bit on this? Thanks a lot! Werner