similar to: Why it is happeing?

Displaying 20 results from an estimated 6000 matches similar to: "Why it is happeing?"

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 ==
2008 Sep 19
3
Giving a domU direct access to a NIC
Hello, I am experimenting with Snort and other IDS and I would like to use Xen for these tests. This would require me to use port mirroring to sent a bunch of packets to a NIC located on my Xen machine. I don''t really know how Xen networking works, but is it possible to give a domU direct access to a NIC ? Or at least give it enough access so that it can see packets that are not for the
2010 Mar 30
2
Problem with expand.grid() function
Hi, good morning, I got following error which looks strange to me while executing this code : > temp <- expand.grid(rep(list(c(1,0)),40)) Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value In addition: Warning message: In rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : NAs introduced by coercion However if I put a small
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
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
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
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
2013 Nov 13
4
start VM Windows
Fresh Ubuntu 13.10 server build with all the latest patches, installed Xen 4.3 and XCP-XAPI. Got Xenbr0 working properly and created an LVM storage repository and a CIFS ISO repository. I can create VM''s no problem at all but whenever I try to start them I get the following error from the log. Only Windows VM. The error comes up almost instantly when trying to start it. Not sure where to
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,
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
2018 Mar 04
0
Change Function based on ifelse() condtion
That's fine. The issue is how you called Lapply_me(). What did you pass as the argument to FUN? And if you did not pass anything that how is FUN declared? You have not shown that in your email. On Sun, Mar 4, 2018 at 7:11 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > My modified function looks below : > > Lapply_me = function(X = X, FUN = FUN, Apply_MC =
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
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
2010 Sep 20
5
XCP ethernet jumbo frames????
Hi, I have an XCP 0.5 box running a few DomUs some of the DomU''s data is stored at (clustered lvm volumes on) a Coraid etherdrive box which is connected via an Ethernet cable to a dedicated card of the XCP box, for which in the network config I'' ve specified: MTU=9344: xe network-param-list uuid=.... gives: MTU ( RW): 9344 on the DomUs if I leave the MTU at 1500 (default
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().
2023 Nov 29
2
Code editor for writing R code
Bert, Posit (formerly RStudio) has moved from RMarkdown to Quarto. They still support RMarkdown but major new features will be in Quarto. For new users a better choice would be Quarto. See https://quarto.org/docs/faq/rmarkdown.html Secondly, the OP stated he was using the VS-Code IDE, so there is no reason to point him to the Posit/RStudio IDE for this functionality which VS-Code supports very
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,
2018 Mar 04
0
Change Function based on ifelse() condtion
Hi Christofer, Before you made the change that I suggested, your program was stopping at the statement: list(...) = list(..) .etc This means that it never tried to execute the statement: return(lapply(X,FUN,...)) Now that you have made the change, it gets past the first statement and tries to execute the statement: return(lapply(X,FUN,...)). That attempt is generating the error message because