search for: ccquant

Displaying 20 results from an estimated 63 matches for "ccquant".

Did you mean: ccoutant
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
2012 May 15
2
pass objects into "..." (dot dot dot)
Hello, Thanks in advance for any help! How do I pass an unknown number of objects into the "..." (dot dot dot) parameter? Put another way, is there some standard way to pass multiple objects into "..." to "fool" the function into thinking the objects are passed in separately/explicitly with common separation (like "x,y,z" when x, y and z are objects to be
2012 Mar 02
3
speed up merge
Hello, I have a nasty loop that I have to do 11877 times. The only thing that slows it down really is this merge: xx1 = merge(dt,ua_rd,by.x=1,by.y= 'rt_date',all.x=T) Any ideas on how to speed it up? The output can't change materially (it works), but I'd like it to go faster. I'm looking at getting around the loop (not shown), but I'm trying to speed up the merge first.
2011 Sep 10
1
DBS to R
Hello, I have a bunch of data files all with "dbs" file extensions. They are generated via a SQL query from another program and source. Does anyone know (or have ideas) how to get the data from a dbs file type into R (or into some other format that can imported to R)? I've searched online for 4 hours now... Thanks! Ben [[alternative HTML version deleted]]
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 26
0
R.oo inheritance with pass by reference
...member in the child class and the parent class for demonstration purposes. This is me giving back to the community...hope it helps. Moral of the story is use your sets and gets rather than obj$dataMember. I am new to R.oo so if you know how to do this better or have some tricks please email me at ccquant@g*m@il.com. setConstructorS3("Person", function(age) { if (missing(age)) age <- NA; extend(Object(), "Person", .age=age ) }) setMethodS3("getAge", "Person", function(this, ...) { this$.age; }) setMethodS3("setAge", "Person&qu...
2011 Aug 29
1
character vector to text with returns
Hello, Does anyone know how to convert this: > msg [1] "a" [2] "b" [3] "c" To: > msg "a b c" In other words, I need to convert a character vector to a single string with carriage returns for each row. Functionally, I'm attempting to send an email of a character vector in a way that is readable in the email body. I can only input one
2011 Sep 27
3
remove NaN from element in a vector in a list
Hello, What is the best way to turn a matrix into a list removing NaN's? I'm new to R... Start: > mt = matrix(c(1,4,NaN,5,3,6),2,3) > mt [,1] [,2] [,3] [1,] 1 NaN 3 [2,] 4 5 6 Desired result: > lst [[1]] [1] 1 3 [[2]] [1] 4 5 6 Thanks! Ben [[alternative HTML version deleted]]
2011 Oct 11
1
apply for each value
Hello, There has to be a more R'ish way to do this. I have two matrices, one has the values I want, but I want to NA some of them. The other matrix has binary values that tell me if I want to NA the values in the other matrix. I produce a third matrix based on this. I've also tried apply() passing in c(1,2) for rows and columns with no success yet. Example (this works, but I'm
2011 Oct 12
1
Tinn-R change editor background color
Hello, Does anyone know how to change the Tinn-R editor background color? White is rough on the eyes... Thanks, 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 >
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 16
1
activate console
Hello, After I plot something how do I reactivate the console (and not the plot window) so I don't have to click on the console each time to go to the next command? Example that does not work: fun = function(x){ plot(x); dev.set(dev.prev())} fun(1:4) ...and another that does not work: fun = function(x){ plot(x); dev.set(NULL)} fun(1:4) Again, by 'not work' I mean I can't seem
2012 Feb 18
1
proto: make a parameter persist
The code below works as expected but: Using the proto package, is this the best way to 1) make a parameter persist if the parameter is passed in with a value, 2) allow for calling the bias() function without a parameter assignment, 3) have the x2 value initialize as 5? Thanks for your feedback. Giving the proto package a test beat and establishing some templates for myself. > oo <-
2012 Mar 01
2
fridays date to date
Hello, How do I get the dates of all Fridays between two dates? thanks, Ben [[alternative HTML version deleted]]
2012 Mar 02
1
data frame of strings formatted
Hello, I have another question.... I have a data frame that looks like this: a b 2007-03-31 "20070514" "20070410" 2007-06-30 "20070814" "20070709" 2007-09-30 "20071115" "20071009" 2007-12-31 "20080213" "20080109" 2008-03-31 "20080514" "20080407" 2008-06-30
2012 Apr 20
1
lines crosses
Hello, If the exact value does not exist in the vector, can I still get at the intersections? Is there a simple way to do this and avoid looping? Seems like there would be a simple R function to do this... Example: vec <- c(5,4,3,2,3,4,5) vec [1] 5 4 3 2 3 4 5 intersect(vec,2.5) numeric(0) I want to get: 2.5 and 2.5 My real data is very large and I don't know the values of anything
2012 Apr 27
2
get plot axis rounding method
Hello, Does anyone know how to get the rounding method used for the axis tick numbers/values in plot()? I'm using mtext() to plot the values used to plot vertical and horizontal lines (using abline()) and I'd like these vertical and horizontal line values to be rounded like the axis tick values are rounded. In other words, I want numbers plotted with mtext() to be rounded in the same
2011 Oct 06
1
counts in quantiles in and from a matrix
Hello, I'm trying to get the count of values in each row that are above and below quantile thresholds. Thanks! Example: > x = matrix(1:30,5,6) > x [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 6 11 16 21 26 [2,] 2 7 12 17 22 27 [3,] 3 8 13 18 23 28 [4,] 4 9 14 19 24 29 [5,] 5 10 15 20 25 30 > qtl = t(apply(x, 1,
2011 Oct 11
1
high and lowest with names
Hello, I'm looking to get the values, row names and column names of the largest and smallest values in a matrix. Example (except is does not include the names): > x <- swiss$Education[1:25] > dat = matrix(x,5,5) > colnames(dat) = c('a','b','c','d','c') > rownames(dat) = c('z','y','x','w','v') >