Displaying 20 results from an estimated 2000 matches similar to: "debugging a code"
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)
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
Problems Creating an R package
Hi all,
When I check my package using "Rcmd check ..\myPackage\R.mykg" on Windows in
Command Prompt, this is what get:-
* using log directory 'C:/R/bin/R.getdata.Rcheck'
* using Version 2.3.1 (2006-06-01)
* checking for file 'R.getdata/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'R.getdata' version '1.0'
* checking
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
2014 Dec 29
3
EATON 9SX not display battery.charge
Any news?
Send dubug with explore one more time
in attach
19.12.2014 15:39, Charles Lepple ?????:
> On Dec 19, 2014, at 5:16 AM, ??????? ??????? <freemgm at gmail.com> wrote:
>
>> # /usr/local/libexec/nut/usbhid-ups -DD -a eaton9sx -u root -x explore -x vendorid=0x0463 2>&1 | tee /tmp/eaton9sx-explore.log
> Ah, I forgot about the vendorid. The string is a regex which
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)
2014 Oct 15
2
[LLVMdev] using -debug-ir to map identify IR mapping
Yes, I am using opt and llc from the same version (3.5).
I know that there were issues with debug-ir in 3.4. I have explored the source tree myself for 3.5 and I know that the pass -debug-ir does kick in with opt.
But I have no clue of what happens with the debug information in (and after) the llc pass.
/Muneeb
On 15 Oct 2014, at 17:14, David Blaikie <dblaikie at gmail.com> wrote:
>
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
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction