Re: [R] making chains from pairs

2013-11-09 Thread David Winsemius
On Nov 8, 2013, at 10:56 AM, Hermann Norpois wrote: Hello, having a data frame like test with pairs of characters I would like to create chains. For instance from the pairs A/B and B/I you get the vector A B I. It is like jumping from one pair to the next related pair. So for my example

[R] Standard errors in regression models with interactions terms

2013-11-09 Thread rm
In a rather simple regression, I’d like to ask the question, for high trees, whether it makes a difference (for volume) whether a three is thick. If my interpretation is correct, for low trees, i.e. for which trees$isHigh == FALSE, the answer is yes. The problem is how to merge the standard

[R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread j. van den hoff
I'd very much appreciate some help here: I'm in the process of clarifying whether I can use `computeContour3d' to derive estimates of the surface area of a single closed isosurface (and prospectively the enclosed volume). getting the surface area from the list of triangles returned by

[R] S4 vs S3. New Package

2013-11-09 Thread daniel schnaider
Hi, I am working on a new credit portfolio optimization package. My question is if it is more recommended to develop in S4 object oriented or S3. It would be more naturally to develop in object oriented paradigm, but there is many concerns regarding S4. 1) Performance of S4 could be an issue as

[R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread daniel schnaider
It is my first time programming with S4 and I can't get the setter fuction to actually change the value of the slot created by the constructor. I guess it has to do with local copy, global copy, etc. of the variable - but, I could't find anything relevant in documentation. Tried to copy examples

Re: [R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread Duncan Murdoch
On 13-11-09 8:50 AM, j. van den hoff wrote: I'd very much appreciate some help here: I'm in the process of clarifying whether I can use `computeContour3d' to derive estimates of the surface area of a single closed isosurface (and prospectively the enclosed volume). getting the surface area from

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread Simon Zehnder
If you want to set a slot you have to refer to it: ac@CustomerID - “54321” or you use your setter: ac - CustomerID(ac, “54321”) What you did was creating a new symbol CustomerID referring to the String “54321” CustomerID - “54321” CustomerID [1] “54321” Best Simon On 09 Nov 2013, at

Re: [R] S4 vs S3. New Package

2013-11-09 Thread Simon Zehnder
This depends very often of on the developer and what he is comfortable with. I like S4 classes, as I come from C++ and S4 classes approximate C++ classes at least more than S3 classes do (Reference Classes would do so even more and I know very good R programmers liking these most). 1) I wrote

Re: [R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread j. van den hoff
On Sat, 09 Nov 2013 17:16:28 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 8:50 AM, j. van den hoff wrote: I'd very much appreciate some help here: I'm in the process of clarifying whether I can use `computeContour3d' to derive estimates of the surface area of a single

Re: [R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread Duncan Murdoch
On 13-11-09 11:57 AM, j. van den hoff wrote: On Sat, 09 Nov 2013 17:16:28 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 8:50 AM, j. van den hoff wrote: I'd very much appreciate some help here: I'm in the process of clarifying whether I can use `computeContour3d' to derive

Re: [R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread j. van den hoff
On Sat, 09 Nov 2013 18:18:23 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 11:57 AM, j. van den hoff wrote: On Sat, 09 Nov 2013 17:16:28 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 8:50 AM, j. van den hoff wrote: I'd very much appreciate some help

Re: [R] Date handling in R is hard to understand

2013-11-09 Thread Carl Witthoft
I agree w/ lubridate.I also would like to mention that date handling is amazingly difficult in ALL computer languages, not just R. Take a stroll through sites like thedailywtf.com to see how quickly people get into tarpits full of thorns when trying to deal with leap years, weeks vs month

Re: [R] C50 Node Assignment

2013-11-09 Thread Carl Witthoft
Just to clarify: I'm guessing the OP is referring to the CRAN package C50 here. A quick skim suggests the rules are a list element of a C5.0-class object, so maybe that's where to start? David Winsemius wrote In my role as a moderator I am attempting to bypass the automatic mail filters

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread Martin Morgan
On 11/09/2013 06:31 AM, daniel schnaider wrote: It is my first time programming with S4 and I can't get the setter fuction to actually change the value of the slot created by the constructor. I guess it has to do with local copy, global copy, etc. of the variable - but, I could't find anything

[R] Tables Package Grouping Factors

2013-11-09 Thread Jeff Newmiller
Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package is used. The following code illustrates my

Re: [R] `level' definition in `computeContour3d' (misc3d package)

2013-11-09 Thread Duncan Murdoch
On 13-11-09 12:53 PM, j. van den hoff wrote: On Sat, 09 Nov 2013 18:18:23 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 11:57 AM, j. van den hoff wrote: On Sat, 09 Nov 2013 17:16:28 +0100, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-11-09 8:50 AM, j. van den

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 1:23 PM, Jeff Newmiller wrote: Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package

[R] Custom Numeric type in R

2013-11-09 Thread Christofer Bogaso
Hi again, In R, there are various numerics like, NA, Inf, or simple integers etc. However I want to include one custom type: TBD, which R should treat as numeric, not character. That TBD should have same property like Inf, however except this: TBD - TBD = 0 In future, I am planning to add few

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 1:23 PM, Jeff Newmiller wrote: Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package

Re: [R] S4 vs S3. New Package

2013-11-09 Thread Rolf Turner
For my take on the issue see fortune(strait jacket). cheers, Rolf Turner P. S. I said that quite some time ago and I have seen nothing in the intervening years to change my views. R. T. On 11/10/13 04:22, daniel schnaider wrote: Hi, I am working on a new credit portfolio

Re: [R] C50 Node Assignment

2013-11-09 Thread Max Kuhn
There is a sub-object called 'rules' that has the output of C5.0 for this model: library(C50) mod - C5.0(Species ~ ., data = iris, rules = TRUE) cat(mod$rules) id=See5/C5.0 2.07 GPL Edition 2013-11-09 entries=1 rules=4 default=setosa conds=1 cover=50 ok=50 lift=2.94231 class=setosa type=2

Re: [R] S4 vs S3. New Package

2013-11-09 Thread Martin Morgan
On 11/09/2013 11:59 AM, Rolf Turner wrote: For my take on the issue see fortune(strait jacket). cheers, Rolf Turner P. S. I said that quite some time ago and I have seen nothing in the intervening years to change my views. Mileage varies; the Bioconductor project attains a

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Jeff Newmiller
The problem that prompted this question involved manufacturers and their model numbers, so I think the cross everything and throw away most of it will get out of hand quickly. The number of models per manufacturer definitely varies. I think I will work on the print segments of the table

Re: [R] S4 vs S3. New Package

2013-11-09 Thread daniel schnaider
Thank you! On Sat, Nov 9, 2013 at 2:30 PM, Simon Zehnder szehn...@uni-bonn.de wrote: This depends very often of on the developer and what he is comfortable with. I like S4 classes, as I come from C++ and S4 classes approximate C++ classes at least more than S3 classes do (Reference Classes

[R] Problem while using searchTwitter function in TwitteR package

2013-11-09 Thread Ameek Singh
Hi, I am data mining from twitter using the twitteR package but I am facing a problem mining statuses. A lot of times the status does not return the desired number of statuses but returns only a specific number. Also, this number keeps on varying for exactly the same arguments ( No, its not that

[R] Using Unicode inside R's expression() command

2013-11-09 Thread Sverre Stausland
I'm using 'expression()' in R plots in order to get italicized text. But it appears as if I cannot use Unicode symbols inside 'expression' outside of ASCII characters. Is there some way I can work around this? My goal is to get the 'fi' ligature in various labels in my R barplots (together with

[R] union of list objects if objects intersect

2013-11-09 Thread Hermann Norpois
Hello, I have a list called ja and I wish to unify list objects if there is some overlap. For instance something like if (length (intersect (ja[[1]], ja[[2]]) !=0) { union (ja[[1]], ja[[2]] } but of course it should work cumulatively (for larger data sets). Could you please give me a hint.

Re: [R] select .txt from .txt in a directory

2013-11-09 Thread arun
Hi, Try: library(stringr) # Created the selected files (98) in a separate working  folder (SubsetFiles1) (refer to my previous mail) filelst - list.files() #Sublst - filelst[1:2] res - lapply(filelst,function(x) {con - file(x)      Lines1 - readLines(con) close(con)      Lines2 - Lines1[-1]

Re: [R] select .txt from .txt in a directory

2013-11-09 Thread arun
HI, The code could be shortened by using ?merge or ?join(). library(plyr) ##Using the output from `lst6` lst7 - lapply(lst6,function(x) {x1 - data.frame(Year=rep(1961:2005,each=12),Mo=rep(1:12,45)); x2 -join(x1,x,type=left,by=c(Year,Mo))}) ##rest are the same (only change in object names)  

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 5:56 PM, Jeff Newmiller wrote: The problem that prompted this question involved manufacturers and their model numbers, so I think the cross everything and throw away most of it will get out of hand quickly. The number of models per manufacturer definitely varies. I think I will

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread Hadley Wickham
Modelling a mutable entity, i.e. an account, is really a perfect example of when to use reference classes. You might find the examples on http://adv-r.had.co.nz/OO-essentials.html give you a better feel for the strengths and weaknesses of R's different OO systems. Hadley On Sat, Nov 9, 2013 at