Displaying 20 results from an estimated 1000 matches similar to: "building a list in loop"
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
2004 Mar 25
2
if block and brackets
Hello
the maunal states "When the if statement is not in a
block the else, if present, must appear on the same
line as statement1. Otherwise the new line at the end
of statement1 yields a syntactically complete
statement that is evaluated."
well, what is wrong with this if structure? I am
getting an error on the line where "else" is
thanks
if (exists("f")){
dt
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
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
> dt1 <- as.Date("2004-12-31")
> dt2 <- as.Date("2005-12-31")
> seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month")
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D
2004 Nov 07
2
Flag file management techniques using rsync
G'day,
I am just getting into rsync and have been very impressed with performance
and reliability. There is one thing I haven't worked out how to do yet and
I haven't found much with several Google sessions or by way of consulting
the examples.
I am looking for a way to check for (or duplicate) single flag files to and
from a remote host (without any dummy spit errors when it is not
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> 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
2009 Jan 10
2
Problem with compiling shared C/C++ library for loading into R (Linux)
I am using the .Call interface to call c++ code from R. For that, I am
trying to create a dynamic library (mylib.so)
using "R CMD SHLIB" by linking my own c++ code and an external c++
library (blitz++).
The makefile works fine on my Mac, produces mylib.so and I am able to
call .Call() from R, but on a linux
server (I think Debian), I got the following error:
----------
/usr/bin/ld:
2009 Jan 10
2
Problem with compiling shared C/C++ library for loading into R (Linux)
I am using the .Call interface to call c++ code from R. For that, I am
trying to create a dynamic library (mylib.so)
using "R CMD SHLIB" by linking my own c++ code and an external c++
library (blitz++).
The makefile works fine on my Mac, produces mylib.so and I am able to
call .Call() from R, but on a linux
server (I think Debian), I got the following error:
----------
/usr/bin/ld:
2010 Apr 27
1
[LLVMdev] llvm-2.7: --with-udis86 failure
Debug build on x86_64 with`--with-udis86=<path>' option to 'configure' seems broken.
Configure command line:
./configure --disable-optimized --enable-assertions --enable-debug-runtime --enable-debug-symbols --enable-jit --enable-pic --enable-targets=x86_64 --with-udis86=/somepath/udis86/udis86-1.7
At least 2 issues:
(1) '-L/somepath/udis86/udis86-1.7' is added to the
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel,
I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000
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)
2010 Aug 11
3
Using command line --file or -f
*What I want to do:
*Create a windows shortcut that will start the R gui **and**
simultaneously source a file
*What I have already tried:
*This almost works, but it's not the interactive R GUI:
R --no-save --sdi -file="C:\SomePath\example.R"
These open the R GUI, but doesn't recognize -f --f --file -file
RGUI --no-save --sdi -file="C:\SomePath\example.R"
2016 Feb 08
3
strace clang refers files from lib/tls/x86_64 multiple times
Greetings!
Sample program:
int main(int argc, char **argv)
{
int myLocal=0xAA;
return 0;
}
Command: clang t.c -o a.o -c
With above simple program we are observing that clang is stat-ing and trying to open various files from lib/tls location. Eventually all calls to "lib/tls" leads to ENOENT (No such file or directory)!
<sample_strace>
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)
2023 Jan 26
2
Resumen de R-help-es, Vol 167, Envío 10
Hola esta es una solución
library(data.table)
library(stringr)
dt <- data.table( V1a = sample(c("1","0"), 10, TRUE)
, V1b = sample(c("1","0"), 10, TRUE)
, V2a = sample(c("1","0"), 10, TRUE)
, V2b = sample(c("1","0"), 10, TRUE)
, V3a =
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
2009 Nov 02
3
question about difference in date objects
Hi R Community:
I want to take the difference in two dates:
dt2 - dt1.
But, I want the answer in months between those 2 dates.
Can you advise me?
Please respond to: pzs6 at cdc.gov
Thank you!
Phil Smith
Centers for Disease Control and Prevention