[R] (simple) xml into data.frame and reverse

2009-07-14 Thread stefan.d...@gmail.com
Hello, I am trying to convert a simple data.frame (it will always be a few equally long variables) into the XML format (which I don't understand too well but need as input for another program) and reverse the operation (from XML back into data.frame). I found some code which does the first and it

Re: [R] (simple) xml into data.frame and reverse

2009-07-15 Thread stefan.d...@gmail.com
Hi Duncan, thanks for the advice and the link. I just realized there is a mistake in the code I posted and I currently don't have the time to correct it. So I can not try your function (yet). But I will do so in the next few days and tell you if it doesnt work. Thanks again and best, Stefan On Wed

[R] Reading a SpreadsheetML / XMLNS into R xmlns="urn:schemas-microsoft-com:office:spreadsheet

2010-03-26 Thread stefan.d...@gmail.com
Hello, I use a software that outputs the data in a form/dialect(?) of xml (I think its called "SpreadsheetML", see below for an excerpt). It allows (admittedly) easy import of such files into Excel. I would like, however, to import it directly into R. I am familiar how to do that with standard xml-

[R] XML: Reading transition matrices into R

2009-11-12 Thread stefan.d...@gmail.com
Hello, from a software I have the following output in xml (see below): It is a series of matrices, for each age one. I have 3 categories (might vary in the application), hence, 3x3 matrices where each element gives the probability of transition from i to j. I would like read this data into R (prefe

Re: [R] XML: Reading transition matrices into R

2009-11-12 Thread stefan.d...@gmail.com
software? Best, Stefan On Thu, Nov 12, 2009 at 3:17 PM, Duncan Temple Lang wrote: > > > stefan.d...@gmail.com wrote: >> Hello, >> from a software I have the following output in xml (see below): >> It is a series of matrices, for each age one. I have 3 categories >&g

Re: [R] XML: Reading transition matrices into R

2009-11-13 Thread stefan.d...@gmail.com
Thank you so much You really helped me a lot! Best from R'dam, Stefan On Fri, Nov 13, 2009 at 2:14 AM, Duncan Temple Lang wrote: > > > stefan.d...@gmail.com wrote: >> Hello, >> thanks a lot. This is a form which I can work with in R. >> >> Another ques

Re: [R] Building US maps in R

2009-05-11 Thread stefan.d...@gmail.com
Hi DD, if you have a .shp file (which in principal should exist of the kind of map your describing) you can load into R using this packages: http://r-spatial.sourceforge.net/ In addition, there is also the R-Geo list which is much more suited for this kind of questions: r-sig-...@stat.math.ethz.c

[R] strange (?) behavoir of expand.grid()

2009-04-07 Thread stefan.d...@gmail.com
Hello, I came across a strange behavior of expand.grid (or at least strange to me). For certain values of one of my input variables - created by seq() - I have to use strings (e.g ==".6") to select a row of the object created by expand.grid(), for other values numerical (e.g. ==.8) and for some b

Re: [R] strange (?) behavoir of expand.grid()

2009-04-07 Thread stefan.d...@gmail.com
Hi ya'll, thanks for pointing out the obvious ;-) I didn't think of that (and I showed it to a fellow colleague who didn't spot it either, I am going to blame her for that). Best, Stefan On Tue, Apr 7, 2009 at 4:52 PM, Karl Ove Hufthammer wrote: > stefan.d...@gmail.com:

[R] Aggregate individual level data to age categories

2020-02-12 Thread stefan.d...@gmail.com
Dear All, I have a seemingly standard problem to which I somehow I do not find a simple solution. I have individual level data where x is a categorical variable with 3 categories which I would like to aggregate by age. age x 45 1 45 2 46 1 47 3 47 3 and so on. It should after transfo

Re: [R] Aggregate individual level data to age categories

2020-02-12 Thread stefan.d...@gmail.com
well, if I think about, its actually a simple frequency table grouped by age. but it should be usable a matrix or data frame. On Wed, Feb 12, 2020 at 9:48 PM wrote: > > So a pivot table? > > On 12 Feb 2020 20:39, stefan.d...@gmail.com wrote: > > Dear All, > > I have a se

Re: [R] Aggregate individual level data to age categories

2020-02-12 Thread stefan.d...@gmail.com
age x Freq > 1 45 11 > 2 46 11 > 3 47 10 > 4 45 21 > 5 46 20 > 6 47 20 > 7 45 30 > 8 46 30 > 9 47 32 > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > > On Wed, Feb 12, 2020 at 1:12 PM stefan.d...

Re: [R] Aggregate individual level data to age categories

2020-02-12 Thread stefan.d...@gmail.com
ibrary(prettyR) > sdtab<-xtab(age~x,sddf) > sdtab$counts > > Jim > > On Thu, Feb 13, 2020 at 7:40 AM stefan.d...@gmail.com > wrote: > > > > Dear All, > > > > I have a seemingly standard problem to which I somehow I do not find > > a simple solution.

[R] xtable for latex: setting some values globally

2010-06-23 Thread stefan.d...@gmail.com
Dear All, a quick xtable question. I do have quite a bunch of tables in my latex document which I produce with xtable. That works fine so far. But I wonder is it possible set some values such as "environement", "caption.placement", or "size" globally so that it applies for table unless otherwise s

Re: [R] xtable for latex: setting some values globally

2010-06-23 Thread stefan.d...@gmail.com
fair enough! I was just hoping there was some free lunch... thanks and best from Rotterdam, Stefan On Wed, Jun 23, 2010 at 4:26 PM, Hadley Wickham wrote: >> If anybody has quick fix, that would be helpful. > > Write your own function that wraps xtable... > > Hadley > > > -- > Assistant Professor

[R] Sweave: The opposite of tangle

2010-06-25 Thread stefan.d...@gmail.com
Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of tangle (that just gives R-chunk). Thanks, Stefan __

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread stefan.d...@gmail.com
Thanks! That was exactly what I was looking for. Best, Stefan On Fri, Jun 25, 2010 at 12:37 PM, Kevin E. Thorpe wrote: > Kevin E. Thorpe wrote: >> >> stefan.d...@gmail.com wrote: >>> >>> Hi, >>> I am using Sweave to write an article. If I want to conve

[R] comparing the fit of two (gamma) distributions for aggregated data

2010-10-06 Thread stefan.d...@gmail.com
Hi, I have aggregated data in 5 categories and want to fit a gamma distribution to it (works fine). My question is that on theoretical grounds I could claim that the observation in the first category (the zero count) are certain, i.e. I know for sure the number. This would then mean in fitting a g

[R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread stefan.d...@gmail.com
Hello, I have data in the following form age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 Int.Prev.Est.4 Int.Prev.Est.5 93110 93 0 23.75482 57.86592 9.755003 4.343534 4.280714 93610 93 1 53.36475 39.47247 4.381618 1.622119 1.159044 94

Re: [R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread stefan.d...@gmail.com
Thanks a lot! Both solutions work great! On Thu, Oct 7, 2010 at 7:19 PM, Gabor Grothendieck wrote: > On Thu, Oct 7, 2010 at 1:05 PM, stefan.d...@gmail.com > wrote: >> Hello, >> I have data in the following form >> >>      age sex Int.Prev.Est.1 Int.Prev.Est.2 In

[R] Decision Trees /Decision Analysis with R?

2011-06-08 Thread stefan.d...@gmail.com
Hello, this question is a bit out of the blue. I am a big R fan and user and in my new job I do some decision modeling (mostly health economics). For that decision trees are often used (I guess the most classic example is the investment decision A, B, and C with different probabilities, what is t

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-08 Thread stefan.d...@gmail.com
ote: > See packages rpart, randomForest, party. > > Also, typing "R Decision Trees" produced good google results. > > http://www.google.com/search?aq=f&sourceid=chrome&ie=UTF-8&q=R+Decision+Trees > > On Wed, Jun 8, 2011 at 7:02 AM, stefan.d...@gmail.com > wrote

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-08 Thread stefan.d...@gmail.com
TreeAge works just fine. But its commercial, thats all... On Wed, Jun 8, 2011 at 6:17 PM, Graham Smith wrote: > Jon, > >> So TreeAge fits models but won't predict from them? That seems like >> bizarre behavior. > > Nothing bizarre about TreeAge, just a different tool in a different > disicpline.

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-09 Thread stefan.d...@gmail.com
t: Re: [R] Decision Trees /Decision Analysis with R? >> >> So TreeAge fits models but won't predict from them? That seems like bizarre >> behavior. I suppose I would recommend, then, looking at the source code from >> the aforementioned packages for how they store the

[R] strange behavior of RODBC and/or ssconvert

2010-05-04 Thread stefan.d...@gmail.com
Dear All, I have the following problem when reading files (a lot of them) in the spreadsheetML format into R. The spreadsheetML format is an xml format to allow easy import of multisheet data in Excel. As far as I can see, a direct import into R (using the XML package) is not feasible. I use the s

[R] constructing a contingency table (ftable, table)

2010-06-08 Thread stefan.d...@gmail.com
Dear all, an hopefully quick table question. I have the following data: Two objects that are 2*9 matrix with nine column names (Dis1, ..., Dis9) and the row names (2010,2020). The content are frequencies (numeric). In want to create a table that is along the lines of ftable(UCBAdmissions) and sho

Re: [R] constructing a contingency table (ftable, table)

2010-06-08 Thread stefan.d...@gmail.com
(cbind(test,test2), >        dim=c(2,9,2), >        dimnames=list(rownames(test),colnames(test),c("Test","Test2"))) > > ftable(as.table(tmp)) > > Cheers > Joris > > On Tue, Jun 8, 2010 at 3:42 PM, stefan.d...@gmail.com > wrote: >> Dear all, >

Re: [R] Decision Trees or Markov Models for Cost Effectiveness

2012-06-14 Thread stefan.d...@gmail.com
Hi Noah, I did ask basically the same question about a year ago and there wasn't anything around (http://tolstoy.newcastle.edu.au/R/e14/help/11/06/3651.html) Although I agree that R would be very suitable for this kind of calculations exist. I guess one reason is that a decision tree is not really

[R] paste together object names to pass it on to a function

2009-01-30 Thread stefan.d...@gmail.com
Hello, I have a maybe trivial question, but I simply don't understand well enought how to work with text/strings: I have a rather compelx data structure, a big list with several sub-lists/dataframes and for certain calculations (which I do in loops), I only need a certain group of sub-lists/data

Re: [R] paste together object names to pass it on to a function

2009-02-02 Thread stefan.d...@gmail.com
; #[1] 55 > > #$LE > #[1] 66 > > #--- > for(i in nam) print(gnuff[[i]]$LE) #use list extraction to get the values > #[1] 55 > #[1] 66 > > > > On Jan 30, 2009, at 12:06 PM, stefan.d...@gmail.com wrote: > >> Hello, >> I have a maybe trivial