similar to: Creating/Reading a complex string in R

Displaying 20 results from an estimated 7000 matches similar to: "Creating/Reading a complex string in R"

2017 Jul 18
4
Creating/Reading a complex string in R
Thanks for your pointer. Is there any way in R how to replace " ' " with " /' " programmatically? My actual string is quite lengthy, so changing it manually may not be possible. I am aware of gsub() function, however not sure I can apply it directly on my original string. Regards, On Tue, Jul 18, 2017 at 10:27 PM, John McKown <john.archie.mckown at gmail.com>
2017 Jul 18
0
Creating/Reading a complex string in R
Try: String = '<html> <head> <script type="text/javascript" <script type="text/javascript"> mystatement(\'current\', {\'pac\':[\'\']}); mystatement;' To embed a single ' mark in a string delimited by ' marks, you must "escape" them by prefixing them with a back-slash \. R version
2017 Jul 19
0
Creating/Reading a complex string in R
It was suggested to quote your string with *backticks* (` ... `) rather than single quotes. String <- `<html> <head> ... ` On 7/18/2017 1:05 PM, Christofer Bogaso wrote: > Thanks for your pointer. > > Is there any way in R how to replace " ' " with " /' " programmatically? > > My actual string is quite lengthy, so changing
2017 Jul 19
2
Creating/Reading a complex string in R
> On Jul 19, 2017, at 5:38 AM, Michael Friendly <friendly at yorku.ca> wrote: > > It was suggested to quote your string with *backticks* (` ... `) rather than single quotes. > > String <- `<html> > <head> > ... > ` That failed for me. The parser considered it a language object, an R name. Here's what I needed to do: > string <-
2015 Aug 13
3
Bug in rank with utf8?
x <- "\u0663" y <- 3 x == y # FALSE rank(c(x, y)) # c(1.5, 1.5) -- http://had.co.nz/
2015 Mar 19
3
CRAN binary, but no source
Hi All, this is a CRAN question, so I am sorry if this is not the appropriate forum. I noticed that there is at least one CRAN package that has a binary (OSX Mavericks) for a version, that does not have any source package on CRAN. Or at least I am unable to locate it. The package is Rglpk: http://cran.r-project.org/web/packages/Rglpk/index.html It offers a binary for 0.5-2, but there is no
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
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
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.
2008 Nov 03
1
How to calculate modulus of complex number
suppose I have following complex number : a = -0.0475983+0.5364486i This number I got as an eigen value of a matrix. Now I would like to calculate the Modulus of this complex number. Is there any function for doing that? Regards, -- View this message in context: http://www.nabble.com/How-to-calculate-modulus-of-complex-number-tp20308154p20308154.html Sent from the R help mailing list archive
2018 Jun 01
2
Unable to take correct Web-snapshot
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/>*, this fails to take the full snapshot of that page. I tried following : > library(webshot) > webshot("https://www.coinbase.com/", 'aa.pdf') However in the pdf page, I done see the quotes which are
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,
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