search for: lst

Displaying 20 results from an estimated 1600 matches for "lst".

Did you mean: list
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"),...
2010 May 06
2
Problem with nested functions - functions nested too deeply in source code
...) (note that all parameters in call refine1 have been defined previosly) Then the following steps look like this ##################################### # Refinement process # ##################################### refine1 <- function(M, A, B, p_A, p_B, FAIL, elim, i, j, k, sc, h, lst, x){ #print("refine 1") # elim marks if there was eliminated a 1 (and changed to 0) lst <- vector(mode = "numeric") elim <- 0 i <- 1 refine2(M, A, B, p_A, p_B, FAIL, elim, i, j, k, sc, h, lst, x) } refine2 <- function(M, A...
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) This snippet errors that data1mn not find and warns that return is deprecating!!!...
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 extract the objects within lst like do_something<-function(L){ a<-lst$a b<-lst$b df<-lst$df g<-lst$g a+b+df+g } do_something(lst) My question is, is it possible to avoid the...
2019 Apr 23
2
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
Hello, it seems an mismatch of schema file provided by dovecot-2.3.5.2 [root at mail conf]# pwd /var/solr/data/dovecot/conf # Below solrconfig.xml is from Solr-8.0.0. [root at mail conf]# grep text_general solrconfig.xml <str name="queryAnalyzerFieldType">text_general</str> field types. Text content will be indexed as "text_general" as <str
2013 Jul 02
2
cache most-recent dispatch
...ng 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, collapse="+") } lst <- split(rep(LETTERS, 100), rep(1:1300, 2)) library(microbenchmark) microbenchmark(fun0(lst), times=10) ## Unit: milliseconds ## expr min lq median uq max neval ## fun0(lst) 4.153287 4.180659 4.513539 5.19261 5.280481 10 setGeneric("paste...
2019 Apr 23
3
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
...;useColdSearcher>false</useColdSearcher> > </query> > <requestDispatcher> > <httpCaching never304="true"/> > </requestDispatcher> > <requestHandler name="/select" class="solr.SearchHandler"> > <lst name="defaults"> > <str name="echoParams">explicit</str> > <int name="rows">10</int> > </lst> > </requestHandler> > <requestHandler name="/query" class="solr.SearchHandler"...
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( "MASS" ) install.packag...
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", "rates&q...
2019 Apr 23
0
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
...</listener> <useColdSearcher>false</useColdSearcher> </query> <requestDispatcher> <httpCaching never304="true"/> </requestDispatcher> <requestHandler name="/select" class="solr.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <int name="rows">10</int> </lst> </requestHandler> <requestHandler name="/query" class="solr.SearchHandler"> <lst name=&qu...
2009 Jul 16
0
Re: Xen-devel Digest, Vol 52, Issue 178
...ntel.com > diff -r 61ec78692b13 tools/python/xen/util/pci.py --- a/tools/python/xen/util/pci.py Wed Jun 17 07:39:27 2009 +0100 +++ b/tools/python/xen/util/pci.py Wed Jun 17 18:35:31 2009 +0800 @@ -547,12 +547,12 @@ class PciDevice: else: dev = {} lst = parent.split(':') - dev['domain'] = int(lst[0], 16) - dev['bus'] = int(lst[1], 16) + dev['domain'] = '%04x' % int(lst[0], 16) + dev['bus'] = '%02x' % int(lst[1], 16)...
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, groupe == names(x)[1])$vd,subset(exple, groupe == names(x)[2])$vd) t <- as.numeric(Tstudent$statistic) if (t >= Tstudent$conf.int[1:2][1] & t <= Ts...
2011 Nov 10
5
Named components in a list
I'm studying lists and I came to an example where > L $name [1] "Fred" $wife [1] "Mary" $no.children [1] 4 $child.ages [1] 4 7 9 then following the instructions to extend the list with a new component, I executed: > L[5] <-list(NewName="something") and the new list I got was: > L $name [1] "Fred" $wife [1] "Mary"
2012 Sep 19
1
different behavior accessing type-specific as.data.frame inside a function vs inside R shell
...<- new( "antsMatrix", "float" ) b <- as.data.frame( a ) this all works fine and i am pleased. fyi, the implementation of as.data.frame is: setMethod( f = "as.data.frame" , signature( x = "antsMatrix" ) , definition = function( x ) { lst = .Call( "antsMatrix_asList" , x ) names(lst)[ 1 : (length(lst)) ] <- lst[[ length(lst) ]] lst[[ length(lst) ]] <- NULL as.data.frame(lst) } ) now the problem comes when i try to access the same functionality in a function that is within my package R so...
2010 Jun 23
4
list operation
Hi,   it seems a simple problem, but I can not find a clear way. I have a list: lst=list(m=c('a','b','c'),n=c('c','a'),l=c('a','bc')) > lst $m [1] "a" "b" "c" $n [1] "c" "a" $l [1] "a"  "bc" how can I get list elements that include a given subset? for e...
2007 Feb 08
5
remove component from list or data frame
Sorry to ask such a simple question, but I can't find the answer after extensive searching the docs and the web. How do you remove a component from a list? For example say you have: lst<-c(5,6,7,8,9) How do you remove, for example, the third component in the list? lst[[3]]]<-NULL generates an error: "Error: more elements supplied than there are to replace" Also, how do you remove a row from a data frame? For example, say you have: lst1<-c(1,2,3,4,5...
2007 Mar 26
5
Listing function
Hallo, I build a list by the following way: Lst = list(name="Fred", wife="Mary", no.children=3, cild.ages=c(4,7,9)) I know how I can extract the information one by one. But now I want to add a new entry which looks like name="Barney", wife="Liz", no.children=2, cild.ages=c(3,5) How can I add this inform...
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 MedAeSQ from HBR model on Testing data > install.packages("robustbase") > install.packages(...
2012 Jan 08
2
splitting strings effriciently
...ction 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 brought to bear on the problem. Does anyone have any thoughts? for(i in 1:4861469) { lst <-unlist(strsplit(data$ComputerName[i], "\\.")) data$IPA[i] <-lst[[1]] data$IPB[i] <-lst[[2]] data$IPC[i] <-lst[[3]] data$IPD[i] <-lst[[4]] rm(lst) } Andrew Andrew Roberts Children's Orthopaedic Surgeon RJAH, Oswestry, UK [[alternative HTML version...
2002 Sep 09
2
lapply-related question
Dear R-gurus, I would like to use a lapply on a kind of "bivariate" problem. I have a vector and a list, components of which are vectors, e.g. vec <- c(1,2,3) lst <- list(1, c(2,3), c(4,5,6)) I want to apply a function to each component of the list, using the corresponding component of the vector as a parameter. E.g. I want a list in the form list(lst[[1]] + vec[1], lst[[2]] + vec[2], .... ) I think this can be achieved with a cycle and probably using...