similar to: Problems Creating an R package

Displaying 20 results from an estimated 500 matches similar to: "Problems Creating an R package"

2006 Jun 26
1
Passing arguments from a function within another function
Hi all, I have a function getSomeData() that is called from command line - getSomeData(id='1240'). The function getSomeData() calls another function getData that needs the exact same argument passed to getSomeData(). I am using the function call getData(paste(names(args[1]), "=", sQuote(args[[1]]))). The argument passed is- id='1240'. The problem is that in
2006 Jun 29
1
Passing argument in nested function calls
Please, do not ask why you would do this. I have simplified my complicated code to just the basic problem occuring to be able to make it easier to understand the actual problem. I have two function getArgs() and extractArgs() - code and test results provided below. I test them using getArgs(id = 's1002') from the command line. getArgs() prints the name of the argument as id and the
2011 Mar 18
1
help please: put output into dataframe
Dear R community members I have been struggling on this simple question, but never get appropriate solution. So please help. # my data, though I have a large number of variables var1 <- rnorm(500, 10,4) var2 <- rnorm(500, 20, 8) var3 <- rnorm(500, 30, 18) var4 <- rnorm(500, 40, 20) datafr1 <- data.frame(var1, var2, var3, var4) # my unsuccessful codes nvar <- ncol(datafr1)
2004 Mar 24
2
debugging a code
Hello just learned HowTo but R, reminded me with the way Perl does it but with much less on-line commands, R "AFAIK" has n, c, Q and where and cann't debug outside the {}. 1) is there a more versatile/flexable debugging method for R? I have saved 2 functions in an ASCII file "digfun". "getdata" function calls "squash" function and both use loops. In
2003 Jan 30
2
Weird options(digits=n) behaviour
I noticed some very weird behaviour of the function: options(digits=n), where n is the number of digits you would expect to get in R calculations. Let's take a example: > options(digits=4) > getdata(caso.pool.k3.r3.e2) [1] 6.053 2.641 -3.639 14.259 6.082 Which works fine... now, trying again, with different data: > options(digits=4) > getdata(controle.pool.k3.r3.e2)
2004 Feb 28
1
when .Call can safely modify its arguments
Hi, "Writing R Extensions Guide" clearly states that a C-function interfaced via .Call() should not modify any of its arguments. However I wonder if there are exceptions to this rule, i.e. when .Call can safely modify the arguments. For example when a function creates a list that is then populated by a call to a C function: getData <- function() { data <- list(a=double(2),
2012 Mar 28
2
Making Knitr work
Might not be the best place to ask, but i could get lucky.. I have setup an eclipse environment to write sweave files lately and wanted to switch to knitr. I could get it to work on easy files, but my earlier written sweave file fails to be knit properly. Here is the error message: Quitting from lines 273-276: Error in setwd(base.dir) : kann Arbeitsverzeichnis nicht wechseln (it says: cannot
2012 Jan 27
1
Overimposing one map in ssplot onto another
Hello! I have 2 maps - both created in ssplot and both identical in terms of outline. Is there any way to superimpose Map1 (which has black borders between Canadian provinces) onto Map2 (which is also a map of Canada)? Thanks a lot for your hints! Dimitri ### A. Reading in Canada data at the province and then at the county level: library(raster) getData('ISO3') # Canada's code is
2012 Nov 06
1
how Can make function for selecting the products
HI. I make this code: getdata<-function('a','b','c' ,'d','e','f'){ drv <- dbDriver("SQLite") con<-dbConnect(drv, "sqlite.db") lt<-dbListTables(con) myf<-data.frame(NULL) for (i in 1:length(lt)) { myfile<-dbReadTable(con,lt[i]) myfile1<-myfile[-c(14:44)] myfile1$MODEL<-gsub(" ",
2007 Jun 14
2
connecting to DB2 database
Hi, i am trying to connect to a DB2 server using the DBI library. getData <- function() { driver <- dbDriver("DB2") conn <- dbConnect(driver,"server","uname","pword") data <- dbSendquery(conn, "select etc.") } When I run the function, i get the error > data <- getData() Error in
2017 Sep 21
1
Improve ScopedPrinter::printNumber? (was: [llvm] r313816 - [llvm-readobj] Fix 'Teach readobj to dump .res files'.)
Seeing the below commit, I wondered whether that's a genuine fix or rather a workaround for a shortcoming in llvm::ScopedPrinter::printNumber. The latter has overloads for [u]int{8,16,32,64}_t, presumably so that it can take arguments of arbitrary integer types. However, at least on recent macOS uint64_t is 'unsigned long long' (and uint32_t is 'unsigned int') while
2006 Nov 17
1
Manipulating R lists in C
Hi, I have been studying the R manual on lists but cannot seem to create a simple R list in C - I keep on getting "'dimnames' applied to non-array" whenever I attempt to assign names to the list elements: Wanted output a list structure something like [ type="Bid", price=2.0, volume=1000 ] I can get up to a list of [ "Bid2, 2.0, 1000 ] But for the life of
2007 Sep 26
0
activerecord multiple databases
So, I was looking for a setup that would allow me to easily query multiple databases and not have to re-write my customer finder type queries. Here is what I came up with and it seems to be working for me in my very basic tests so I thought I''d share. Just posting it in case this helps anyone else trying to do the same thing. I''m using this with activerecord, but not rails, so
2008 Nov 30
2
Snow and multi-processing
Dear R gurus, I have a very embarrassingly parallelizable job that I am trying to speed up with snow on our local cluster. Basically, I am doing ~50,000 t.test for a series of micro-array experiments, one gene at a time. Thus, I can easily spread the load across multiple processors and nodes. So, I have a master list object that tells me what rows to pick up for each genes to do the t.test from
2004 Mar 27
1
building a list in loop
Hello getdata <- function(p){ fname <- NULL; dl <- list()#build the sturcture builddl <- function(q,s){ fname <<- c(fname,s) #where "s" is a string dl <<- list( dl, dt2) } list(names = fname, data = dl) } data <- getdata("c:\somepath") > data $names [1] "fname" $data $data[[1]] <--- since there is no [[1]] how can I stop
2009 Oct 01
5
How to use Subpopulation data?
Dear Helpers   I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.   H <- matrix(rnorm(100, mean=50000, sd=5000)) sampleframe=data.frame(type=c(rep("H",100)),value=c(H)) sampleframe   str=strata(sampleframe,c("type"),size=c(20,), method="srswor")
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: library(raster)
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: library(raster)
2013 Feb 04
1
is it possible to create a trellis object with multiple colorkeys/z-scale axis?
Dear R users- Do the lattice/latticeExtra packages support multiple tileplots with unique colorkeys? I am trying to create a visualization of the encounter rate of certain stocks of salmon across two years. The issue I am having is that some stocks are encountered at much higher rates than others.the high encounter rate for one stock washes out the patterns I'm hoping to visualize across the
2006 Jan 26
7
Print Migrator help needed...
Hi, I am trying to migrate print queues from a windows server to a samba share. 1. I ran printmig.exe on the windows server. 2. Backed up the printers on the windows servers to a cab file. 3. Tries to restore the printers to the sambashare by specifying the target as //sambaShare. But I get the following error: 2006:01:25 15:35:38 Access Granted to: \\sambaShare 2006:01:25 15:35:38