similar to: Question on list object

Displaying 20 results from an estimated 240 matches similar to: "Question on list object"

2011 Jan 20
5
Creating/Protecting a Subnet
I have an admin machine, and a backup server which does backups. The backup server has IPMI so I can do lights-out admin, and I want to allow this from the admin machine only. IPMI is completely unfirewalled, and so it must have a different class C than working networks.... this is just how it is. I''ve set the IPMI IP on the backup server to 192.168.10.4, and created a virtual
2009 Jul 04
2
x86_64 EDAC throwing error
Hi All, We have installed CentOS 5.3 x86_64 in an HP DL585 server with AMD Opteron 64 bit processor and 16 GB RAM. The kernel version is 2.6.18-128.el5 . Now this has thrown an error message in /var/log/message, Jul 3 21:41:11 db1 kernel: EDAC k8 MC0: general bus error: participating processor(local node origin), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem
2012 Jul 21
2
two questions re: the use of lattice
Dear friends, I have two questions regarding the use of lattice. First some code: ## begin code z <- cbind(rep(c("BIC", "ICL", "s_v", "Q_v", "sig-q", "s_lsk", "s_lML", "s_mlsk", "s_mlML", "s_la8", "s_haar"), each = 250), rep(c(5, 10, 20, 30, 50), each = 50)) z
2008 May 11
5
Are you writing "imperative" or "declarative" scenarios in your stories?
Hey all, I just found Bryan Helmkamp''s (of webrat fame) slides on a presentation he did at GoRuCo 2008: http://www.brynary.com/2008/4/26/story-driven-development-slides-posted On slides 21-24 he talks about writing good stories and shows gives two examples.. the way not to do it and the way to do it. You can also see the video of the presentation at confreaks
2010 Aug 03
4
force b/w printing
Has anyone an idea, how to force users to print b/w on a color printer. We are in the process to deploy color printers to some of our offices where they use centos 5.5 as their OS. They need the printers to print some advertisement material. But for everything else, they don't need it. And because of the costs of the color printing we would like to force them to use B/W where not explicitly
2009 Jun 18
7
7110 questions
Hi all, (down to the wire here on EDU grant pricing :) i''m looking at buying a pair of 7110''s in the EDU grant sale. The price is sure right. I''d use them in a mirrored, cold-failover config. I''d primarily be using them to serve a vmware cluster; the current config is two standalone ESX servers with local storage, 450G of SAS RAID10 each. the 7110 price
2018 Mar 04
3
Change Function based on ifelse() condtion
Below is my full implementation (tried to make it simple as for demonstration) Lapply_me = function(X = X, FUN = FUN, Apply_MC = FALSE, ...) { if (Apply_MC) { return(mclapply(X, FUN, ...)) } else { if (any(names(list(...)) == 'mc.cores')) { myList = list(...)[!names(list(...)) %in% 'mc.cores'] } return(lapply(X, FUN, myList)) } } Lapply_me(as.list(1:4), function(xx) { if (xx ==
2010 Jul 10
7
Need help on date calculation
Hi all, please see my code: > library(zoo) > a <- as.yearmon("March-2010", "%B-%Y") > b <- as.yearmon("May-2010", "%B-%Y") > > nn <- (b-a)*12 # number of months in between them > nn [1] 2 > as.integer(nn) [1] 1 What is the correct way to find the number of months between "a" and "b", still
2018 Mar 04
2
Change Function based on ifelse() condtion
My modified function looks below : Lapply_me = function(X = X, FUN = FUN, Apply_MC = FALSE, ...) { if (Apply_MC) { return(mclapply(X, FUN, ...)) } else { if (any(names(list(...)) == 'mc.cores')) { myList = list(...)[!names(list(...)) %in% 'mc.cores'] } return(lapply(X, FUN, myList)) } } Here, I am not passing ... anymore rather passing myList On Sun, Mar 4, 2018 at 10:37 PM,
2018 Mar 04
0
Change Function based on ifelse() condtion
The reason that it works for Apply_MC=TRUE is that in that case you call mclapply(X,FUN,...) and the mclapply() function strips off the mc.cores argument from the "..." list before calling FUN, so FUN is being called with zero arguments, exactly as it is declared. A quick workaround is to change the line Lapply_me(as.list(1:4), function(xx) { to Lapply_me(as.list(1:4),
2018 Mar 04
2
Change Function based on ifelse() condtion
@Eric - with this approach I am getting below error : Error in FUN(X[[i]], ...) : unused argument (list()) On Sun, Mar 4, 2018 at 10:18 PM, Eric Berger <ericjberger at gmail.com> wrote: > Hi Christofer, > You cannot assign to list(...). You can do the following > > myList <- list(...)[!names(list(...)) %in% 'mc.cores'] > > HTH, > Eric > > On Sun, Mar
2012 Dec 14
5
A question on list and lapply
Dear all, let say I have following list: Dat <- vector("list", length = 26) names(Dat) <- LETTERS My_Function <- function(x) return(rnorm(5)) Dat1 <- lapply(Dat, My_Function) However I want to apply my function 'My_Function' for all elements of 'Dat' except the elements having 'names(Dat) == "P"'. Here I have specified the name
2017 Aug 02
4
Extracting numeric part from a string
Hi again, I am struggling to extract the number part from below string : "\"cm_ffm\":\"563.77\"" Basically, I need to extract 563.77 from above. The underlying number can be a whole number, and there could be comma separator as well. So far I tried below : > library(stringr) > str_extract("\"cm_ffm\":\"563.77\"",
2012 Mar 16
4
How to start R in maximized size???
Dear all, when I start R, I want that the console window should be in the Maximized size automatically. Can somebody help me how to achieve that? Thanks and regards,
2011 Nov 10
5
A question on Programming
Dear all. Let say I have a group of codes which will be used in many places in my overall R-code files. These group of codes will be used within a for-loop (with a big length, like 10000 times) and also many other places outside of that for loop. As this group of codes are being used in many places, I thought to put them within a user-defined function. Here my question is, is there any speed
2013 Mar 28
4
How to replace '$' sign?
Hello again, I want to remove "$" sign and replace with nothing in my text. Therefore I used following code: > gsub("$|,", "", "$232,685.35436") [1] "$232685.35436" However I could not remove '$' sign. Can somebody help me why is it so? Thanks and regards
2011 Jan 21
3
How to look into the asterisked function?
Hi friends, there is methods() function to see the all available methods for a particular function, for example: > head(methods("print")) [1] "print.acf" "print.anova" "print.aov" "print.aovlist" "print.ar" "print.Arima" In this list, there are some functions which are asterisked like print.acf().
2017 Aug 10
3
Zoo rolling window with increasing window size
Hi Joshua, thanks for your prompt reply. However as I said, sum() function I used here just for demonstrating the problem, I have other custom function to implement, not necessarily sum() I am looking for a generic solution for above problem. Any better idea? Thanks, On Fri, Aug 11, 2017 at 12:04 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote: > Use a `width` of integer index
2018 Mar 04
2
Change Function based on ifelse() condtion
Hi, As an example, I want to create below kind of custom Function which either be mclapply pr lapply Lapply_me = function(X = X, FUN = FUN, ..., Apply_MC = FALSE) { if (Apply_MC) { return(mclapply(X, FUN, ...)) } else { if (any(names(list(...)) == 'mc.cores')) { list(...) = list(...)[!names(list(...)) %in% 'mc.cores'] } return(lapply(X, FUN, ...)) } } However when Apply_MC =
2013 Jan 03
3
Question on Round function
I happened to see these: > round(.5, 0) [1] 0 > round(1.5, 0) [1] 2 > round(2.5, 0) [1] 2 > round(3.5, 0) [1] 4 > round(4.5, 0) [1] 4 What is the rule here? Should not round(.5, 0) = 1, round(2.5, 0) = 3 etc? Thanks and regards,