similar to: proto: make a parameter persist

Displaying 20 results from an estimated 20000 matches similar to: "proto: make a parameter persist"

2011 Nov 08
2
multi-line query
Hello, I'm using package RpgSQL. Is there a better way to create a multi-line query/character string? I'm looking for less to type and readability. This is not very readable for large queries: s <- 'create table r.BOD("id" int primary key,"name" varchar(12))' I write a lot of code, so I'm looking to type less than this, but it is more readable from
2011 Aug 23
1
R.oo modify an object inside another classes method
Can someone show me how to modify one (R.oo) class's object inside another (R.oo) class's method? Is that possible with the R.oo package? A quick example or reference to an example would be outstanding... Thanks, Ben [[alternative HTML version deleted]]
2011 Aug 08
1
R.oo error upon construction
Hello, Using the R.oo package, how do I throw an error if a field is not present when the user of the class creates the object? Using the example in the R.oo package: setConstructorS3("Person", function(name, age) { if (missing(name)) name <- NA; if (missing(age)) age <- NA; extend(Object(), "Person", .name=name, .age=age ) }) [rest of class methods
2011 Nov 08
1
dbWriteTable with field data type
Hello, When I do: dbWriteTable(con, "r.BOD", cbind(row_names = rownames(BOD), BOD)) ...can I specify the data types such as varchar(12), float, double precision, etc. for each of the fields/columns? If not, what is the best way to create a table with specified field data types (with the RpgSQL package/R)? Regards, Ben [[alternative HTML version deleted]]
2011 Nov 07
1
RpgSQL row names
Hello, Using the RpgSQL package, there must be a way to get the row names into the table automatically. In the example below, I'm trying to get rid of the cbind line, yet have the row names of the data frame populate a column. > bentest = matrix(1:4,2,2) > dimnames(bentest) = list(c('ra','rb'),c('ca','cb')) > bentest ca cb ra 1 3 rb 2 4 >
2012 Apr 18
2
quarter end dates between two date strings
Hello, I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to get every quarter period end date between those dates? Does anyone know how to do this? Speed is important... Here is a small sample: Two dates: "2007-01-31" "2012-01-31" And I'd like to get this: [1] "2007-03-31" "2007-06-30"
2011 Nov 08
2
match first consecutive list of capitalized words in string
Dear R-Helpers, this is my first post ever to a mailing list, so please feel free to point out any missunderstandings on my side regarding the conventions of this mailing list. My problem: Assuming the following character vector is given: names <- c("filia Maria", "vidua Joh Dirck Kleve (oo 02.02.1732)", "Bernardus Engelb Franciscus Linde j.u.Doktor referendarius
2011 Apr 30
2
create namespace without creating a package?
Hi all, I am a C++/C# programmer who is new to R. I would like to use something like "namespace" to organize my functions without creating a package. How can I do this? Thanks! xiagao1982 2011-04-30 [[alternative HTML version deleted]]
2011 May 26
3
change function scope?
I'm still getting used to R's scoping. I've run into the following situation value=0 thefunction <- function() print( value ) somefunction <- function() { value=99; thefunction() } somefunction() now, I understand that somefunction() returns 0 because thefunction() was defined with value=0 in its parent envrionment, it dosent look at all in the environment of somefunction. My
2010 Jul 27
2
Documenting different OO-aproaches in R as a package?
Hello, I see some people including myself confused by the different object-oriented approaches in R (S3, S4, OOP, R.oo etc.). Would it be ok to collect examples and solutions for the different OO-packages in one package and add a vignette for documentation? (assuming I find time for this task) I mean in this case the package would not add data or functionality to R or serve as a companion
2009 Jan 30
1
OO programming & S3/S4 paradigm - General question
Hi, Being relatively new to OO programming and not so old on R, I noticed the possibility to do OO programming in R. But it seems there is two "paradigms" S3 that seems the old one but is the one used in the R.oo package and S4 which seems more recent As a starting point, which one is best to use? Is R.oo useful? what are the main difference between the two? Any feedback
2011 Jun 07
1
Packages for R-CRAN (organizing aspects)
Hello, I have some ideas for packages that I want to provide on R-CRAN. One package alreads is working, but I have some warnings in when compiling. Also I don't know if the libraries in use are only working on Unix/Linux. So I have some general questions: - If I'm not sure if the code would also work on windows (needing some ceratain libraries or tools), would it be better to
2009 Oct 26
3
R.oo and S4?
There are different way to make R classes. I know R.oo and S4. I'm wondering which one is the current popular one. Which one is current recommended when make new R packages? Thank you!
2013 Jan 31
5
Modify objects in function
Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think a little harder on implementation style (especially to spare users complex object handling). I have a function foo(), taking as input arguments two S4 objects of different class
2005 Apr 21
3
Objects in R
Hi, A few comments from a fairly experienced R user who worked for several years on a R-based bioinformatics analysis framework. I don't want to misrepresent anyone's views, but... There are real disadvantages to the "objects-as-C-structs" and functions/methods which "mutate" based on argument type. i.e. S4. (1)Novices simply don't understand it.
2007 Jan 19
5
C vs. C++ as learning and development tool for R
I have 3 years of experience with R and have an interest in becoming a better programmer so that I might someday be able to contribute packages. Other than R, my only experience was taking Lisp from Daniel Friedman in the 1970's. I would like to learn either C or C++ for several reasons: To gain a better concept of object oriented programming so that I can begin to use S4 methods in R. To
2012 Mar 05
1
index instead of loop?
Hello, Does anyone know of a way I can speed this up? Basically I'm attempting to get the data item on the same row as the report date for each report date available. In reality, I have over 11k of columns, not just A, B, C, D and I have to do that over 100 times. My solution is slow, but it works. The loop is slow because of merge. # create sample data z.dates =
2007 Sep 14
2
Building an R GUI using gWidgets and RGtk2
Hello, I'm developing a GUI in R that will be used to monitor financial portfolio performance. The GUI will be distributed as an R package. So far, I've decided to use the "cairoDevice", "RGtk2", "gWidgets", and "gWidgetsRGtk2" packages to develop the GUI. I am trying to decide what would be the best way to structure the GUI would be. I've
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this? More specifically, do I have to rewrite all of the data members stuff and extend stuff of parent class in the child class? See below. Thanks in advance! Example 1: setConstructorS3("ClassA", function(A,x) { if(missing(A))A=15; if(missing(x))x=NA; extend(Object(), "ClassA", .size = A, .x=x
2010 May 28
2
5.4-->5.5 Upgrade broke OO 3.2.0
In order to get an OpenOffice configuration that is closer in compatibility with MS Office 2007, I removed the standard OO in 5.4 via yum and installed the latest (3.2.0) from OpenOffice.org. Ran that config for many months without a problem. However, when I allowed the upgrade to 5.5, OO broke. I finally had to remove all traces of OO 3.2.0, and start over. That worked...until yum tells me that