Displaying 20 results from an estimated 9000 matches similar to: "different behavior accessing type-specific as.data.frame inside a function vs inside R shell"
2013 Apr 10
1
question re: error message --- package error: "functionName" not resolved from current namespace
hello everyone
we are developing a package that has worked up until R3.0 which we just
tested.
the issue is as above .... when we call a function that works in R 2.15.2
from R 3.0 we get an error
Error in .Call("antsImageRead", filename, pixeltype, dimension) :
"antsImageRead" not resolved from current namespace (ANTsR)
this Error occurs when the .Call is made from
2011 Jun 09
1
Using a function inside a function
I'm trying to run a function inside a function but get an error message.
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "quotes"),
suffix2 = c("rate", "rates"), suffix3 =
2016 Oct 27
1
using with inside loop breaks next
If I want to use with inside a loop, it seems that next gets confused.
To reproduce:
for(lst in list(list(a = 1), list(a = 2), list(a = 3)))
{
with(lst, if(a == 2) next else print(a))
}
I expect 1 and 3 to be printed, but I see
[1] 1
Error in eval(expr, envir, enclos) :
no loop for break/next, jumping to top level
Is this
a) by design, or
b) a bug, or
c) a thing that is rare enough that I
2011 Jun 09
2
Problem with a if statement inside a function
I have a really long functions, and at the end of the function, I am using a
if statement
to tag certain keywords based on whether they have certain values contained
in them.
However, the if statement doesn't seem to work.
When I had split up the commands into various functions, it worked fine, but
I'm not sure
what going on now that it's combined into a single function.
myfunc
2019 Jul 02
3
Format printing inside a matrix
Hi everyone,
I am not sure if there is an existing solution to this, but I want my S4
objects inside a list matrix showing correctly. Currently it shows as:
R> str(lst[[1]])
Formal class 'Basic' [package "symengine"] with 1 slot
..@ ptr:<externalptr>
R> matrix(lst, 2)
[,1] [,2] [,3] [,4] [,5]
[1,] ? ? ? ? ?
[2,] ? ? ? ? ?
Is it
2010 May 06
2
Problem with nested functions - functions nested too deeply in source code
Hi all!
I¹m just implementing the Ullmann¹s algorithm for searching subgraph
isomorphisms in graphNEL objects. The algorithm is running with smaller
graphs, but when I¹m calling it i get an R error message saying that
functions are nested too deeply in source code. I found out that the problem
is in the so called refinement procedure of the algorithm which consists of
10 different functions,
2019 Apr 23
3
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
https://wiki.dovecot.org/Plugins/FTS/Solr
Only offers a solr-7.7.0 solrconfig.xml, does it apply to solr-8.0.0?
On Tue, Apr 23, 2019 at 11:18 AM luckydog xf <luckydogxf at gmail.com> wrote:
> Here is solrconfig.xml, I removed comments.
> --------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <config>
>
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
I'm writing a function and keep getting the following error message.
myfunc <- function(lst) {
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "quotes"),
suffix2 = c("rate",
2013 Jul 02
2
cache most-recent dispatch
Hi,
S4 method dispatch can be very slow. Would it be reasonable to cache the
most
recent dispatch, anticipating the next invocation will be on the same
type? This
would be very helpful in loops.
fun0 <- function(x)
sapply(x, paste, collapse="+")
fun1 <- function(x) {
paste <- selectMethod(paste, class(x[[1]]))
sapply(x, paste,
2007 Jul 18
1
Neuman-Keuls
hello,
I have programmed this function to calculate the Neuman-Keuls test but I have a problem the function return an empty list and I don't know why.
summary(fm1)
E <- sqrt((summary(fm1)[[1]]["Residuals","Mean Sq"])/length(LR))
lst <- list()
lst1 <- list()
lst2 <- list()
NK <- function (x) {
if (length(x) == 2) {
Tstudent <- t.test(subset(exple,
2012 Nov 26
3
Passing lists between functions
I'd like to pass a list object created by one function as an argument of
another function. once inside the second function, I'd like to break the
list up to it's individual elements, each then identifiable by the 'names'
of the list.
The list looks something like
lst<-list(a=1, b=2, df=5, g=7)
then inside the function I've been writing a sequence of statements that
2006 Nov 09
3
function
R-help,
I am trying to create a function that i pass a data set to and have the
function return some calculations based on data.
Allow me to illustrate:
myfunc <- function(lst,mn,sd){
lst <- sort(lst)
mn <- mean(lst)
sd <- sqrt(var(lst))
return(lst,mn,sd)
}
data1 <-c (1,2,3,4,5)
data2 <- c(6,7,8,9,10)
myfunc(data1,data1mn,data1sd)
myfunc(data2,data2mn,data2sd)
2018 May 08
0
Average of results coming from B=100 repetitions (looping)
On 5/8/2018 12:26 PM, varin sacha via R-help wrote:
>
> Dear R-experts,
>
> Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work.
> Any help would be highly appreciated >
> ####################
>
> ?## R script for getting MedAe and
2018 May 08
4
Average of results coming from B=100 repetitions (looping)
Dear R-experts,
Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work.
Any help would be highly appreciated.
####################
?## R script for getting MedAe and MedAeSQ from HBR model on Testing data
install.packages("robustbase")
install.packages(
2012 Jan 08
2
splitting strings effriciently
Folks,
I have a data frame with 4861469 rows that contains an ip address
xxx.xxx.xxx.xxx as one of the columns. I want to assign a site to each
row based on IP ranges. To do this I have a function to split the ip
address as character into class A,B,C and D components. It works but is
horribly inefficient in terms of speed. I can't quite see how one of the
l/s/m/t/apply functions could be
2007 Dec 31
2
the woes of NA
Joyful.
I'm adapting a FORTRAN 77 package for use with R. Pretty
straightforward.
Except for a glitch it took me some time to figure out. This existing
package has subroutines which have parameters called "NA". So, I called
subroutines like
bnodes <- function(n, lst, lptr, lend, nodes, nb, na, nt)
{
ensure.all.numeric(list(n, lst, lptr, lend, nodes, nb, n.a, nt),
2008 Oct 07
1
using assign with lists
I am performing many permutations on a data-set with each permutation
producing a variable number of results. I thought that the best way to keep
track of all this in one object would be with a list ('res.lst'). To address
these variable results for each permutation I attempted to construct this
list using 'assign'. There is even more nesting than indicated below, but
this is a
2008 Mar 27
2
Rule for accessing attributes?
Hi !
I am a new user and quite confused by R-indexing.
Make a list and get the attributes
lst <- list(x = 1:3, y = 4:6, z = 7:9)
attributes(lst)
This returns:
$names
[1] "x" "y" "z"
I can easily do:
nm <-names(lst)
or
nm <-attr(lst,"names")
which both return the assigned names of the named list 'lst', but why
then this doesn't
2018 Dec 08
2
Solr
After some testsing, I managed to get proper functionning
- The schema.xml is attached below (quite different from the one
provided on teh wiki) (in bold the core differences) (NGramFilterFactory
is the class that replace the fts_squat "partial=3 full=15", everything
else is just a big hammer to smash a tiny fly)
- One need to remove the "managed-schema" file in the
2005 Jan 31
2
type of list elements in .Call
Dear People,
Here is something I do not understand. Consider
*************************************************
foo.cc
*************************************************
#include <iostream>
#include <R.h>
#include <Rinternals.h>
using std::cout;
using std::endl;
extern "C"
{
SEXP printlst(SEXP lst);
}
SEXP printlst(SEXP lst)
{
for(int i=0; i<length(lst);