search for: christofer

Displaying 20 results from an estimated 88 matches for "christofer".

2018 Mar 04
2
Change Function based on ifelse() condtion
...om 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), function(xx,dummyList) { HTH, Eric On Sun, Mar 4, 2018 at 7:21 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > 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 (an...
2018 Mar 04
1
Change Function based on ifelse() condtion
...at gmail.com> wrote: > 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 = FALSE, ...) { >> if (Apply_MC) { >> return(mclapply(X, FUN, ...)) >> } else { >> if (any(names(l...
2018 Mar 04
1
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 = FALSE, ...) { > if (Apply_MC) { > return(mclapply(X, FUN, ...)) > } else { > if (any(names(list(...)) == 'mc.cores')) { >...
2018 Mar 04
1
Change Function based on ifelse() condtion
...(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, Eric Berger <ericjberger at gmail.com> wrote: > 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 &gt...
2018 Mar 04
1
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 stateme...
2018 Mar 04
1
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 4, 2018 at 6:38 PM, Christofer Bogaso > <bogaso.christofer at gmail.com> wrote: >> >> Hi, &g...
2012 Dec 01
12
Getting all possible contingency tables
Hello all, Let say I have 2-way contingency table: Tab <- matrix(c(8, 10, 12, 6), nr = 2) and the Chi-squared test could not reject the independence: > chisq.test(Tab) Pearson''s Chi-squared test with Yates'' continuity correction data: Tab X-squared = 1.0125, df = 1, p-value = 0.3143 However I want to get all possible contingency tables under this
2013 Apr 29
3
Need help on matrix calculation
Hello again, Let say I have 1 matrix: Mat <- matrix(1:12, 4, 3) rownames(Mat) <- letters[1:4] Now I want to subscript of Mat in following way: Subscript_Vec <- c("a", "e", "b", "c") However when I want to use this vector, I am geting following error: Mat[Subscript_Vec, ] Error: subscript out of bounds Basically I want to get my final matrix
2012 Mar 16
6
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,
2018 Mar 04
1
Change Function based on ifelse() condtion
Hi Christofer, You cannot assign to list(...). You can do the following myList <- list(...)[!names(list(...)) %in% 'mc.cores'] HTH, Eric On Sun, Mar 4, 2018 at 6:38 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > Hi, > > As an example, I want to create below kind of...
2017 Oct 09
1
load() failed to load .Rdata file in AWS-Ububtu
...f mine, which appears failing due to load() function issue. If I comment out that line my shiny app is working correctly locally and globally. otherwise, locally my shiny app is working but not with AWS. On Mon, Oct 9, 2017 at 12:37 PM, Eric Berger <ericjberger at gmail.com> wrote: > Hi Christofer, > The shiny code you have written does not depend on loading the Dat.RData > file. > I commented out that line and ran your shiny app on my machine and it works > fine. > What happens if you comment out (or remove) the line > load("/home/ubuntu/Dat.RData) &...
2017 Aug 10
2
Zoo rolling window with increasing window size
...likely want = > "right" (or rollapplyr(), as I used). > > R> set.seed(21) > R> x <- rnorm(10) > R> rs <- rollapplyr(x, seq_along(x), sum) > R> cs <- cumsum(x) > R> identical(rs, cs) > [1] TRUE > > > On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso > <bogaso.christofer at gmail.com> wrote: >> Hi again, >> >> I am wondering there is any function for 'zoo' time series, where I >> can apply a user defined function rolling window basis, wherein window >> size is ever increasing i.e. not fixed....
2010 Jun 16
7
Reading data from xls..........please help
Can anyone help me how to read xls file into R. I have tried following library(gdata) xlsfile <- file.path(.path.package(''gdata''),''xls'',''iris.xls'') read.xls(xlsfile) I got following error: Converting xls file to csv file... Error in system(cmd, intern = !verbose) : perl not found Error in file.exists(tfn) : invalid ''file''
2017 Aug 10
1
Zoo rolling window with increasing window size
Replace "sum" with your custom function's name. I don't see any reason why that wouldn't work, and the problem with my solution is not clear in your response. r <- rollapplyr(x, seq_along(x), yourCustomFunctionGoesHere) On Thu, Aug 10, 2017 at 1:39 PM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote: > 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 soluti...
2017 Oct 09
1
load() failed to load .Rdata file in AWS-Ububtu
Hi Christofer, The shiny code you have written does not depend on loading the Dat.RData file. I commented out that line and ran your shiny app on my machine and it works fine. What happens if you comment out (or remove) the line load("/home/ubuntu/Dat.RData) Does your shiny app still fail?...
2017 Jul 18
3
Creating/Reading a complex string in R
...uot;<html>\n <head>\n <script type=\"text/javascript\" <script > type=\"text/javascript\">\n mystatement('current', {'pac':['']});\n > mystatement;" > > > > On Tue, Jul 18, 2017 at 11:48 AM, Christofer Bogaso > <bogaso.christofer at gmail.com> wrote: >> >> Hi again, >> >> Let say I have below string (arbitrary) >> >> <html> >> <head> >> <script type="text/javascript" <script type="text/java...
2018 Jun 01
1
Unable to take correct Web-snapshot
Thanks for that information. However how can I use R to directly get data from that API? On Fri, Jun 1, 2018 at 8:36 PM Martin M?ller Skarbiniks Pedersen < traxplayer at gmail.com> wrote: > On 1 June 2018 at 15:08, Christofer Bogaso <bogaso.christofer at gmail.com> > wrote: > > Hi again, > > > > I use the *webshot* package to take snapshot from Webpage. However, when > I > > try to take snapshot from* https://www.coinbase.com/ > > <https://www.coinbase.com...
2002 Oct 15
3
glm and Newey-West estimator
Dear R-users, has anybody combined the glm function with the Newey-West estimator of variance, similar as in Stata 7.0? I''d like to estimate corrected standard errors within a logistic regression model, taking into account the auto-correlated binary observations within individuals. I use R1.5.1 on Mac OS X (10.2). Thanks, Christof
2017 Aug 23
3
Getting all possible combinations
Hi again, I am exploring if R can help me to get all possible combinations of members in a group. Let say I have a group with 5 members : A, B, C, D, E Now I want to generate all possible unique combinations with all possible lengths from that group e.g. 1st combination : A 2nd combination : B ..... 5th combination : E 6th combination : A, B 7th combination : B, C .... last combination: A, B,
2004 Mar 22
2
Handling of NAs in functions lrm and robcov
Hi R-helpers I have a dataframe DF (lets say with the variables, y, x1, x2, x3, ..., clust) containing relatively many NAs. When I fit an ordinal regression model with the function lrm from the Design library: model.lrm <- lrm(y ~ x1 + x2, data=DF, x=TRUE, y=TRUE) it will by default delete missing values in the variables y, x1, x2. Based on model.lrm, I want to apply the robust covariance