Displaying 20 results from an estimated 1000 matches similar to: "isFALSE"
2009 Nov 05
1
combine UserDefinedDatabase and regular environments
Hello,
Is it possible to have the effect of UserDefinedDatabase outside of
"attached" environments ? Can I disguise an environment of the
sys.frames() as a UserDefinedDatabase ?
This seems to suggest that it might be possible :
> f <- function(){ e <- environment(); class(e) <-
"UserDefinedDatabase"; ff }
> f()
*** caught segfault ***
address (nil),
2009 Nov 07
1
getConnection, R_outpstream_st
Hello,
I'm trying to use the limited connections api defined in Rinternals.h. I
have code that looks like this (inspired from do_serializeToConn) :
SEXP serialize_to_connection( SEXP xp, SEXP connection ){
Rconnection con ;
struct R_outpstream_st out;
R_pstream_format_t type = R_pstream_binary_format ;
SEXP (*hook)(SEXP, SEXP) = NULL ;
con = getConnection(Rf_asInteger(connection));
2009 Oct 09
1
celebrating revision 50000
Hello,
Today, Brian Ripley commited the revision 50000 of R's svn repository.
I took this as an opportunity to do some data analysis of the log and
posted some code and graphics on my blog:
http://romainfrancois.blog.free.fr/index.php?post/2009/10/09/celebrating-R-commit-50000
The plots of the number of commits per day (and per month) indicates a
peak in 2002.
Here are the top 20
2018 Mar 14
0
Possible Improvement to sapply
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com>
>>>>> on Tue, 13 Mar 2018 10:12:55 -0700 writes:
> FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut
> some corners compared to identical():
> > microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE))
> Unit: nanoseconds
> expr
2009 Oct 13
1
for loop over S4
Hello,
Consider this :
> setClass("track", representation(x="numeric", y="numeric"))
[1] "track"
> o <- new( "track", x = 1, y = 2 )
> for( i in o ){
+ cat( "hello\n")
+ }
Error: invalid type/length (S4/1) in vector allocation
This happens at those lines of do_for:
n = LENGTH(val);
PROTECT_WITH_INDEX(v =
2018 Mar 13
2
Possible Improvement to sapply
FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut
some corners compared to identical():
> microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE))
Unit: nanoseconds
expr min lq mean median uq max neval
identical(FALSE, FALSE) 984 1138 1694.13 1218.0 1337.5 13584 100
isFALSE(FALSE) 713 761 1133.53 809.5 871.5
2009 Oct 27
1
recover and "called from" information
Hello,
When using recover, the called from information is always "eval(expr,
envir, enclos)", which is not particularly useful.
> f <- function( ){ g <- function(){ stop( "ouch") }; g() }
> options( error = recover )
> f()
Error in g() : ouch
Enter a frame number, or 0 to exit
1: f()
2: g()
Selection: 1
Called from: eval(expr, envir, enclos)
I'm
2009 Nov 09
1
\\signature macro generated by promptMethods
Hello,
promptMethods generate a macro for signatures, but the macro does not
exist in the Rd parser.
> setClass("track",
+ representation(x="numeric", y="numeric"))
[1] "track"
> setGeneric("foo", function(x){ standardGeneric("foo") } )
[1] "foo"
> setMethod( "foo", "track",
2018 Jul 30
2
Code Optimization: print.data.frame + as.data.frame(head(x, n = options("max.print")))
Dear R Developers,
I would like to propose a simple optimization for print.data.frame
base function:
To add: x <- as.data.frame(head(x, n = options("max.print")))
This would prevent that, if for example, we have a 10GB data.frame
(e.g.: Instead of a data.table), and we accidentally print it, the R
Session does not "collapse", forcing us to press ESC or kill the
RSession.
2009 Oct 12
1
unexpected behaviour of isSymmetric() (PR#14000)
Full_Name: Mike Danilov
Version: 2.9.0
OS: Fedora Core 9
Submission from: (NULL) (142.103.121.198)
When checking for the symmetry of a matrix, function isSymmetric.matrix() gets
confused by the discrepancy of colnames/rownames if its argument. See the code
snippet below. Perhaps it's a problem of the matrix product which copies
colnames of the first argument but not the rownames of the
2009 Oct 16
2
Urgent help requested to modify a script
I am hoping someone will tak up this chalenge (I am new to R)
I have inheritied an R script but need to change it. The script currently
includes hardcoded file locations on lines 12,166 and 167. I need to modify
this script to allow the folder to be passed as a command line argument to
Rscript.exe
Can anybody help please?
Regards,
Ian
http://www.nabble.com/file/p25924237/My_script.R
2009 Oct 28
1
how can i call R program from one java program?
Dear All
I want to call the R program from one Java program because In my project R
program parameters are set by one web page developed by java.
Is this possible to call R program from java?
many thanks in advance
--
Wesley C Mathew
[[alternative HTML version deleted]]
2009 Oct 13
4
Creating a list of empty lists
Well here is one more brain-teaser related to assigning stuff into a
list of list. What if I need to create a new list of empty lists? I have
actually got a solution to this problem:
l = list(list())
for ( i in sequence(length-1) )
{
l = list(unlist(l,recursive=FALSE), list())
}
But it is not very neat to do this in a loop. Are there any cuter ways
to do this?
2009 Oct 13
3
Function to find prime numbers
I need to create a function to find all the prime numbers in an array. Can
anyone point me in the right direction?
Thank you.
AJ
--
View this message in context: http://www.nabble.com/Function-to-find-prime-numbers-tp25868633p25868633.html
Sent from the R help mailing list archive at Nabble.com.
2019 Aug 15
4
Feature request: non-dropping regmatches/strextract
A very common use case for regmatches is to extract regex matches into a new column in a data.frame (or data.table, etc.) or otherwise use the extracted strings alongside the input. However, the default behavior is to drop empty matches, which results in mismatches in column length if reassignment is done without subsetting.
For consistency with other R functions and compatibility with this use
2019 Mar 02
1
stopifnot
A private reply by Martin made me realize that I was wrong about
stopifnot(exprs=TRUE) .
It actually works fine. I apologize. What I tried and was failed was
stopifnot(exprs=T) .
Error in exprs[[1]] : object of type 'symbol' is not subsettable
The shortcut
assert <- function(exprs) stopifnot(exprs = exprs)
mentioned in "Warning" section of the documentation similarly fails
2009 Oct 15
1
Problems with rJava and tm packages
I am looking to do some text analysis using R and have run into some issues
with some of the packages. Im not sure if its my goofy Vista OS or what but
using R 2.8.1 i s relatively successful loading the text but the rJava
package was messed up somehow:
library(tm)
> library(rJava)
Error in if (!nchar(javahome)) stop("JAVA_HOME is not set and could not be
determined from the
2009 Oct 02
1
environment( seq.int ) is NULL
... and also all objects that actually live in the .GenericArgsEnv
environment.
> all( sapply( ls( .GenericArgsEnv ), function(.)
is.null(environment(.)) ) )
[1] TRUE
This has the consequence preventing argsAnywhere to get the args of
seq.int.
> argsAnywhere( seq.int )
Error in exists(".packageName", envir = envir, inherits = FALSE) :
use of NULL environment is defunct
2009 Nov 13
2
How to show all the functions and classes that are defined in a library?
library(some_library_name)
Suppose I load a library. I'm wondering what command I should use to
list all the functions, classes and variables defined in the library.
2009 Nov 20
1
Including local dynamic libraries
Hi All,
I am trying to install the package rjags into a local library on a
machine for which I do not have root permissions.
Using the command: R CMD INSTALL --configure-args="--with-jags-include=
${JAGSBIN}/include/JAGS --with-jags-lib=${JAGSBIN}/lib/ --with-jags-
modules=${JAGSBIN}/lib/JAGS/modules" CMD INSTALL -l ${JAGSBIN}/lib/ ../
rjags_1.0.3-12.tar.gz
Where ${JAGSBIN} is