Re: [R] web scraping image

2015-06-09 Thread boB Rudis
You can also do it with rvest httr (but that does involve some parsing): library(httr) library(rvest) url - http://nwis.waterdata.usgs.gov/nwis/peak?site_no=12144500agency_cd=USGSformat=img; html(url) %% html_nodes(img) %% html_attr(src) %% paste0(http://nwis.waterdata.usgs.gov;, .) %%

Re: [R] Change Julian function in SPlus to R date code

2015-06-10 Thread boB Rudis
The parameters for the built-in julian() are a bit different. This should be what you can use: start - julian(as.Date(sprintf(%d-%d-%d, nn, mt1, 1)), origin=as.Date(1971-01-01)) end - julian(as.Date(sprintf(%d-%d-%d, nn, mt2, 1)), origin=as.Date(1971-01-01)) On Wed,

[R] [R-pkgs] Version 0.8.5 of metricsgraphics is on CRAN

2015-06-22 Thread boB Rudis
Version 0.8.5 of metricsgraphics is now on CRAN. It provides an 'htmlwidgets' interface to the 'MetricsGraphics.js' ('D3'-based) charting library which is geared towards displaying time-series data. There are routines for scatterplots, histograms and even 'grid.arrange'-like functionality for

Re: [R] Call to a function

2015-06-23 Thread boB Rudis
You can do something like: aaa - function(data, w=w) { if (class(w) %in% c(integer, numeric, double)) { out - mean(w) } else { out - mean(data[, w]) } return(out) } (there are some typos in your function you may want to double check, too) On Tue, Jun 23, 2015 at 5:39 PM, Steven

Re: [R] reading daily snow depth data

2015-06-16 Thread boB Rudis
This look similar to snow data I used last year: https://github.com/hrbrmstr/snowfirst/blob/master/R/snowfirst.R All the data worked pretty well. On Tue, Jun 16, 2015 at 3:21 PM, jim holtman jholt...@gmail.com wrote: Here is an example of reading in the data. After that it is a data frame and

Re: [R] Web crawling amazon website using R

2015-06-30 Thread boB Rudis
You might want to read Amazon's terms of service before crawling their site: http://www.amazon.in/gp/help/customer/display.html/ref=footer_cou/276-8549425-3823542?ie=UTF8nodeId=200545940 On Tue, Jun 30, 2015 at 3:33 AM, Abhinaba Roy abhinabaro...@gmail.com wrote: Hi R helpers, I want to crawl

Re: [R] data frame formatting

2015-08-18 Thread boB Rudis
Here's one way in base R: df - data.frame(id=c(A,A,B,B), first=c(BX,NA,NA,LF), second=c(NA,TD,BZ,NA), third=c(NA,NA,RB,BT), fourth=c(LG,QR,NA,NA)) new_df - data.frame(do.call(rbind, by(df, df$id, function(x) { sapply(x[,-1],

Re: [R] help_ReverseGeocoding

2015-07-28 Thread boB Rudis
You should use ggmap::revgeocode (it calls google's api) and google will rate-limit you. There are also packages to use HERE maps geo/revgeo lookups http://blog.corynissen.com/2014/10/making-r-package-to-use-here-geocode-api.html and the geocode package has GNfindNearestAddress, so tons of options

Re: [R] Knit R and Book Publishing

2015-08-06 Thread boB Rudis
https://github.com/hadley/adv-r is how it was done. On Thu, Aug 6, 2015 at 8:33 AM, Bert Gunter bgunter.4...@gmail.com wrote: I would have thought that the first place to look was R Studio support site. You will find a lot of (Imo well done) docs there as well as links to Hadley's and Yihui's

Re: [R] modifying a package installed via GitHub

2015-07-18 Thread boB Rudis
You can go to the package directory: cd /some/path/to/package and do R CMD install . from a command-line there. Many github-based packages are also made using RStudio and you can just open the .Rproj file (i.e. load it into R studio) and build the package there which will install it.

Re: [R] Modifying graphs in 'survrec' package

2015-10-25 Thread boB Rudis
As answered here: http://stackoverflow.com/a/1444/1457051 palette(c("red", "blue", "orange")) par(lty=3) plot(fit,ylim=c(0,1),xlim=c(0,2000)) though, as indicated in that post, you'll need to customize the survrec:::plot.survfitr function to do more detailed customization. On

Re: [R] Problem R markdown document

2015-08-27 Thread boB Rudis
Try increasing the memory for pandoc via knitr YAML options: -- title: TITLE output: html_document: pandoc_args: [ +RTS, -K64m, -RTS ] --- ref: http://stackoverflow.com/a/28015894/1457051 you can bump up those #'s IIRC, too, if they don't work at first. On Thu, Aug 27,

Re: [R] How to download this data

2015-08-25 Thread boB Rudis
Looks like you can get what you need from http://www.nseindia.com/homepage/Indices1.json on that page. On Tue, Aug 25, 2015 at 2:23 PM, Bert Gunter bgunter.4...@gmail.com wrote: This is not a simple question. The data are in an html-formatted web page. You must scrape the html for the data and

Re: [R] Does R work on Mac OS 10.11?

2015-10-05 Thread boB Rudis
I use it daily (hourly, really) on 10.11 (including the new betas). No issues. On Mon, Oct 5, 2015 at 10:03 AM, R Martinez wrote: > Has anyone tried to use R 3.2.2 on a Mac running OS 10.11 El Capitan? Did it > work? Were any problems installing and running it? > > Thanks in

Re: [R] extracting a value from XML

2015-09-21 Thread boB Rudis
The " > observation_start="2015-09-01" observation_end="2015-09-01" > units="lin" output_type="1" file_type="xml" > order_by="observation_date" sort_order="asc" count="1" offset="0" > limit="10"> > date="2015-09-01" value="0.46"/> > ' > > doc <- read_xml(txt) > xml_attr(xml_find_all(doc,

Re: [R] extracting a value from XML

2015-09-21 Thread boB Rudis
This is how (one way) in both the xml2 package and XML package: library(xml2) library(XML) txt <- ' ' doc <- read_xml(txt) xml_attr(xml_find_all(doc, "//observation"), "value") doc1 <- xmlParse(txt) xpathSApply(doc1, "//observation", xmlGetAttr, "value") On Mon, Sep 21, 2015 at 2:01 PM,

Re: [R] Error: could not find function "VectorSource" in package tm

2015-12-30 Thread boB Rudis
Do you have any code? Any more logs from the error? It's hard to help when you've provided little more than an error message. What does the output of: library(tm) docs <- c("This is a text.", "This another one.") (vs <- VectorSource(docs)) generate? On Wed, Dec 30, 2015 at 2:32 PM,

Re: [R] printing a data.frame that contains a list-column of S4 objects

2016-01-12 Thread boB Rudis
I wonder if something like: format.list <- function(x, ...) { rep(class(x[[1]]), length(x)) } would be sufficient? (prbly needs more 'if's though) On Tue, Jan 12, 2016 at 12:15 PM, Jenny Bryan wrote: > Is there a general problem with printing a data.frame when it has a >

Re: [R] Help: How to Convert Binary Data into Text Using R

2016-06-12 Thread boB Rudis
Welcome to R and R-help! It would help others help you if you provided a minimal example and explained your situation with a bit more details. It's pretty vague as it stands. Base R has both a `readBin()` and `rawConnection()` functions (amongst other tools for such things) and there are a few

Re: [R] R help - Web Scraping of Google News using R

2016-05-24 Thread boB Rudis
What you are doing wrong is both trying yourself and asking others to violate Google's Terms of Service and (amongst other things) get your IP banned along with anyone who aids you (or worse). Please don't. Just because something can be done does not mean it should be done. On Tue, May 24, 2016

Re: [R] How to replace all commas with semicolon in a string

2016-05-27 Thread boB Rudis
You can use gsub() instead of sub() On Fri, May 27, 2016 at 11:10 AM, Jun Shen wrote: > Dear list, > > Say I have a data frame > > test <- data.frame(C1=c('a,b,c,d'),C2=c('g,h,f')) > > I want to replace the commas with semicolons > > sub(',',';',test$C1) -> test$C1 will

Re: [R] Map of Italy data filled at the level of the province

2016-06-02 Thread boB Rudis
This should help you get started: library(maptools) library(ggplot2) library(ggalt) library(ggthemes) library(tibble) library(viridis) # get italy region map italy_map <- map_data("italy") # your data will need to have these region names print(unique(italy_map$region)) #

Re: [R] Kendall heat map

2016-06-17 Thread boB Rudis
Did you try: cor(mat, method="kendall", use="pairwise") That only provides the matrix (so the equiv of the $r list component), but that seems to be all you need. On Fri, Jun 17, 2016 at 5:47 AM, Shane Carey wrote: > Hi, > > I was hoping someone could help me. I was

Re: [R] merging df with world map

2016-06-20 Thread boB Rudis
you also don't need to do a merger if you use a base `geom_map()` layer with the polygons and another using the fill (or points, lines, etc). On Fri, Jun 17, 2016 at 5:08 PM, MacQueen, Don wrote: > And you can check what David and Jeff suggested like this: > > intersect(

Re: [R] printing a data.frame that contains a list-column of S4 objects

2016-01-14 Thread boB Rudis
shoehorned into a data.frame. That happens more often than I'd like in modern API calls (really complex/nested JSON being returned). On Thu, Jan 14, 2016 at 3:34 AM, Martin Maechler <maech...@stat.math.ethz.ch> wrote: >>>>>> boB Rudis <b...@rudis.net> >>>>>>

Re: [R] issue -- Packages unavailable for R version 3.2.3

2016-02-24 Thread boB Rudis
Will you be able to fix the issues that crop up (or even notice the issues) for these unsupported packages? (There _is_ a reason they aren't in CRAN anymore.) That particular one (which is, indeed, archived in CRAN) also depends on Rstem, which is also archived on CRAN, and now (according to CRAN)

Re: [R] issue -- Packages unavailable for R version 3.2.3

2016-02-24 Thread boB Rudis
>'It's not unlikely that you will need a copy of "Writing R Extensions" at >hand.' + a few bottles of Scotch. It might be worth approaching rOpenSci https://ropensci.org/ to take over resurrection/maintenance of this. But, it seems others are in your predicament:

Re: [R] Password-Shiny

2016-02-23 Thread boB Rudis
What would cause you to think this mailing list is a free code-writing service? Perhaps post your question on Amazon's Mechanical Turk service? Alternatively: purchase a license for Shiny Server Pro. On Tue, Feb 23, 2016 at 12:45 AM, Venky wrote: > Hi R users, > > Please

Re: [R] R editor for Mac

2016-01-21 Thread boB Rudis
Aye. You can make source/editor windows consume the entire area or have them as separate windows and can define a consistent line-ending vs platform native (I run RStudio Preview and [sometimes] dailies and can confirm these are in there). The addition of full R (C/C++/HTML/javascript/etc) code

Re: [R] R editor for Mac

2016-01-21 Thread boB Rudis
Here you go Ista: https://atom.io/packages/repl (Atom rly isn't bad for general purpose data sci needs, I still think RStudio is the best environment for working with R projects). On Thu, Jan 21, 2016 at 12:48 PM, Ista Zahn wrote: > On Jan 21, 2016 12:01 PM, "Philippe

Re: [R] Error opening SHP file

2016-01-21 Thread boB Rudis
Agreed with the others. After finding that shapefile and getting it to work you are definitely not in the proper working directory. On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius wrote: > >> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help >>

Re: [R] Error opening SHP file

2016-01-22 Thread boB Rudis
shx component of the shapefile or whatever. >> >> BUT you probably shouldn't be using readShapeSpatial anyway, as it has >> a habit of not reading the coordinate system in the .prj file. I find >> it much easier to use `raster::shapefile` which *does* read the >> coordi

Re: [R] R editor for Mac

2016-01-20 Thread boB Rudis
If you don't want to run RStudio, Sublime Text has both great R code syntax highlighting/formatting and a REPL mode for an interactive console in-editor. Atom also has decent R support. They both play well with "Dash" which is an alternative way (separate app) to lookup R docs on OS X. On Wed,

Re: [R] qplot Error Message

2016-01-23 Thread boB Rudis
Assuming that's qplot from ggplot2, it's trying to pass span to the Point Geom which doesn't recognize it. I highly suggest moving away from using qplot and working with the stat_s and geom_s directly with ggplot(). On Sat, Jan 23, 2016 at 8:46 AM, Jeff Reichman wrote: >

Re: [R] Solution to communicating with UDP and other interfaces (under Linux) using R

2016-04-09 Thread boB Rudis
Hey Bob, If you're interested, I'd be glad to see what I can do to make doing UDP comms from R accessible across platforms without the need for a `system()` call. Mind shooting me a private e-mail to see what your needs are so I can try to generalize a solution from them? -Bob On Sat, Apr 9,

Re: [R] CRAN package check results tabulated ... wasRe: Number of package in Ubuntu

2016-04-24 Thread boB Rudis
Or grab https://cran.r-project.org/web/checks/check_results.rds and read it w/o the need for scraping. On Sat, Apr 23, 2016 at 10:43 AM, David Winsemius wrote: > >> On Apr 23, 2016, at 6:56 AM, David Winsemius wrote: >> >> >>> On Apr 22, 2016, at

Re: [R] web scraping tables generated in multiple server pages

2016-05-10 Thread boB Rudis
Unfortunately, it's a wretched, vile, SharePoint-based site. That means it doesn't use traditional encoding methods to do the pagination and one of the only ways to do this effectively is going to be to use RSelenium: library(RSelenium) library(rvest) library(dplyr)

Re: [R] web scraping tables generated in multiple server pages

2016-05-11 Thread boB Rudis
d Winsemius <dwinsem...@comcast.net> wrote: > >> On May 10, 2016, at 1:11 PM, boB Rudis <b...@rudis.net> wrote: >> >> Unfortunately, it's a wretched, vile, SharePoint-based site. That >> means it doesn't use traditional encoding methods to do the pagination >> and

Re: [R] web scraping tables generated in multiple server pages

2016-05-11 Thread boB Rudis
low.com/questions/27080920/how-to-check-if-page-finished-loading-in-rselenium> would probably also be better (waiting for a full page load signal), but I try to not use [R]Selenium at all if it can be helped. -Bob On Wed, May 11, 2016 at 2:00 PM, boB Rudis <b...@rudis.net> wrote: &g

Re: [R] Assistance with httr package with R version 3.3.0

2016-05-10 Thread boB Rudis
I don't fully remember, but I doubt httr::content() ever returned a character vector without using the `as="text"` parameter. Try switching that line to: html <- content(r, as="text") On Tue, May 10, 2016 at 3:27 AM, Luca Meyer wrote: > Hi Jim, > > Thank you for your

Re: [R] Mean of hexadecimal numbers

2016-04-16 Thread boB Rudis
grDevices has `convertColor()` and the `colorspace` has other functions that can convert from RBG to Lab space. You should convert the RGB colors to Lab and average them that way (or us other functions to convert to HSL or HSV). It all depends on what you are trying to accomplish with the

Re: [R] Microsoft R Server

2016-04-14 Thread boB Rudis
Yes. Yes. That info is on their site. That info is on their site. They have paid support for their customers and non-Microsoft-R-platform-dependent packages will (most likely) still be answered by the community. This is just a re-branding and expansion of what was Revolution R which has been

Re: [R] Ocr

2016-07-26 Thread boB Rudis
https://cran.rstudio.com/web/packages/abbyyR/index.html https://github.com/greenore/ocR https://electricarchaeology.ca/2014/07/15/doing-ocr-within-r/ that was from a Google "r ocr" search. So, yes, there are options. On Tue, Jul 26, 2016 at 6:43 PM, Achim Zeileis

Re: [R] Please assist me to download this data

2016-07-25 Thread boB Rudis
Valid parameters for the form would be super-helpful. On Mon, Jul 25, 2016 at 3:52 PM, Ulrik Stervbo wrote: > Hi Christofer, > > If you can load all the data into R you don't need to query the website - > you simply filter the data by your dates. > > I think that's the

Re: [R] Has R recently made performance improvements in accumulation?

2016-07-19 Thread boB Rudis
Ideally, you would use a more functional programming approach: minimal <- function(rows, cols){ x <- matrix(NA_integer_, ncol = cols, nrow = 0) for (i in seq_len(rows)){ x <- rbind(x, rep(i, 10)) } x } minimaly <- function(rows, cols){ x <- matrix(NA_integer_, ncol = cols, nrow =

Re: [R] Aggregate rainfall data

2016-07-13 Thread boB Rudis
use `gsub()` after the `as.character()` conversion to remove everything but valid numeric components from the strings. On Wed, Jul 13, 2016 at 6:21 AM, roslinazairimah zakaria wrote: > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > > I

Re: [R] Can R read Word fonts and comments?

2016-07-05 Thread boB Rudis
course), which you highlighted for comment? > > Thanks, > > John > > > > 2016-07-02 14:12 GMT-07:00 boB Rudis <b...@rudis.net>: >> >> I just added `docx_extract_all_cmnts()` (and a cpl other >> comments-related things) to the dev version of `docxt

[R] [R-pkgs] New package uaparserjs 0.1.0 - Slice up browser user agent strings

2016-08-09 Thread Bob Rudis
I keep forgetting I can announce things here. [Insert witty/standard boilerplate introductory verbiage here] CRAN: GitHub: Until Oliver and/or I figure out a way to get uap-r

Re: [R] Can R read Word fonts and comments?

2016-07-02 Thread boB Rudis
I just added `docx_extract_all_cmnts()` (and a cpl other comments-related things) to the dev version of `docxtractr` (https://github.com/hrbrmstr/docxtractr). You can use `devtools::install_github("hrbrmstr/docxtractr")` to install it. There's an example in the help for that function. Give it a

[R] [R-pkgs] New package: hrbrthemes

2017-02-27 Thread Bob Rudis
Hey folks, I'm pleased to announce the inaugural release of my hrbrthemes (0.1.0) on CRAN: https://CRAN.R-project.org/package=hrbrthemes The primary goal of said package is to provide opinionated typographical and other aesthetic defaults for ggplot2 charts. Two core themes are included: -

Re: [R] paste0 in file path

2016-08-31 Thread Bob Rudis
if the files are supposed to be "1r.xlsx", "2r.xlsx" (etc) then you need to ensure there's a "/" before it. It's better to use `file.path()` to, well, build file paths since it will help account for differences between directory separators on the various operating systems out there. On Wed, Aug

Re: [R] impossible # of errors in a simple code

2016-09-04 Thread Bob Rudis
pretty sure you just missed the `{` at the beginning of the `function` definition block. On Sun, Sep 4, 2016 at 7:38 AM, Michael Dewey wrote: > A useful rule is to fix the first error you understand and hope that the > others go away. > > On 04/09/2016 04:05, Tamar

Re: [R] Better use of regex

2016-09-15 Thread Bob Rudis
Base: Filter(Negate(is.na), sapply(regmatches(dimInfo, regexec("HS_(.{1})", dimInfo)), "[", 2)) Modernverse: library(stringi) library(purrr) stri_match_first_regex(dimInfo, "HS_(.{1})")[,2] %>% discard(is.na) They both use capture groups to find the matches and return

Re: [R] Opening or activating a URL to access data, alternative to browseURL

2016-09-29 Thread Bob Rudis
The rvest/httr/curl trio can do the cookie management pretty well. Make the initial connection via rvest::html_session() and then hopefully be able to use other rvest function calls, but curl and httr calls will use the cached in-memory handle info seamlessly. You'd need to store and retrieve

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Bob Rudis
No need to bring in so many dependencies for a simple ggplot2 marplot: ds <- stack(ds) ggplot(ds[ds$values==1,], aes(ind)) + geom_bar() On Wed, Oct 5, 2016 at 10:17 AM, Thierry Onkelinx wrote: > Here is a ggplot2, tidyr, dplyr solution > > library(tidyr) >

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Bob Rudis
(s/marplot/barplot) On Wed, Oct 5, 2016 at 10:35 AM, Bob Rudis <b...@rud.is> wrote: > No need to bring in so many dependencies for a simple ggplot2 marplot: > > ds <- stack(ds) > ggplot(ds[ds$values==1,], aes(ind)) + geom_bar() > > On Wed, Oct 5, 2016 at

Re: [R] Problem installing rgdal.

2016-10-04 Thread Bob Rudis
​Hey Ron, I (literally, in the correct use of the term) fired up an Ubuntu 16.04 vagrant box - https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04 - and then did: lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial

Re: [R] Accelerating binRead

2016-09-17 Thread Bob Rudis
You should probably pick a forum — here or SO : http://stackoverflow.com/questions/39547398/faster-reading-of-binary-files-in-r : - vs cross-post to all of them. On Sat, Sep 17, 2016 at 11:04 AM, Ismail SEZEN wrote: > I noticed same issue but didnt care much :) > > On

Re: [R] Retrieving data from survey in R Studio

2016-08-18 Thread Bob Rudis
Ulrik: you can absolutely read from a URL in read.csv() with that syntax. The error `## Error in attach(survey): object 'survey' not found` suggests that the OP mis-typed something in the `survey` name in the assignment from `read.csv()`. However, the OP has quite a bit more to be concerned

[R] [R-pkgs] A few new packages on CRAN

2016-10-03 Thread Bob Rudis
- ndjdon : Wicked Fast ndjson Reader Reads in ndjson significantly faster than jsonlite::stream_in(), flattens each JSON record and returns a data.table. https://cran.r-project.org/web/packages/ndjson/index.html - htmltidy : Clean Up or Pretty Print Gnarly HTML and XHTML C-backed

Re: [R] Convert a list with NULL to a dataframe with NA

2016-10-02 Thread Bob Rudis
It's fairly straightforward with help from the purrr package: library(purrr) map_df(OB1, function(x) { if (length(x) == 0) { data.frame(id=NA_character_, nam=NA_character_, stringsAsFactors=FALSE) } else { data.frame(id=x[1], nam=names(x), stringsAsFactors=FALSE) } }, .id="V1")

Re: [R] About converting files in R

2016-10-25 Thread Bob Rudis
I'm afraid we'll need more information that that since the answer from many folks on the list to such a generic question is going to be a generic "yes". What's the source of the binary files? If you know the type, there may even be an R package for it already. On Tue, Oct 25, 2016 at 5:28 PM,

Re: [R] About converting files in R

2016-10-25 Thread Bob Rudis
Can you tell us where you got the file from and perhaps even send a link to the file? I know of at least 11 types of files that use `.bin` as an extension which are all different types of data with different binary formats. On Tue, Oct 25, 2016 at 5:40 PM, Bob Rudis <b...@rud.is> wrote:

Re: [R] Help with decrypting

2016-11-07 Thread Bob Rudis
Perhaps https://cran.r-project.org/web/packages/bcrypt/index.html might be of assistance. If not, drop a note back to the list as it'll be trivial to expand on that to give you an R alternative to Perl. On Mon, Nov 7, 2016 at 5:47 PM, MacQueen, Don wrote: > I have a file

Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Bob Rudis
Ugly idea/option, but you could base64 encode the R script (solely to avoid the need to do string quoting) and have that string in the source of the R.net code, then pass it in to the eval portion or write it out to a temp dir and pass that to the eval portion of the code. That way the script is

Re: [R] gtools Gator infected...

2016-10-22 Thread Bob Rudis
I think your tool is a bit overzealous. VirusTotal - https://virustotal.com/en/file/5fd1b2fc5c061c0836a70cbad620893a89a27d9251358a5c42c3e49113c9456c/analysis/ & https://virustotal.com/en/file/e133ebf5001e1e991f1f6b425adcfbab170fe3c02656e3a697a5ebea961e909c/analysis/ - shows no sign of any malware

Re: [R] JSON to Dataframe

2016-10-18 Thread Bob Rudis
If those are in "ndjson" files or are indeed single records, `ndjson` functions will be a few orders of magnitude faster and will produce perfectly "flat" data frames. It's not intended to be a replacement for `jsonlite` (a.k.a. the quintessential JSON pkg for R) but it's tailor made for making

Re: [R] rsync: failed to connect to cran.r-project.org (137.208.57.37): No route to host (113)

2016-10-24 Thread Bob Rudis
I ran traceroutes & BGP traces from Marseille & Paris routers to that CRAN IPv4 address (it's 10hrs after your mail, tho) and there's no network errors. You can use any CRAN mirror, though. You aren't limited to that one. On Mon, Oct 24, 2016 at 9:49 AM, Etienne Borocco

Re: [R] function which returns number of occurrences of a pattern in string

2016-10-20 Thread Bob Rudis
`stringi::stri_count()` I know that the `stringr` pkg saves some typing (it wraps the `stringi` pkg), but you should really just use the `stringi` package. It has many more very useful functions with not too much more typing. On Thu, Oct 20, 2016 at 5:47 PM, Jan Kacaba

Re: [R] create n suffixes of length 1:n from string of length n

2016-10-19 Thread Bob Rudis
purrr::map(paste0(letters, collapse=""), ~purrr::map2_chr(., 1:nchar(.), ~substr(.x, 1, .y)))[[1]] seems to crank really fast at least on my system what did you try that was slow? On Wed, Oct 19, 2016 at 11:01 AM, Witold E Wolski wrote: > Is there a build in function, which

Re: [R] The equivalent of which() when accessing slots in an object

2016-10-31 Thread Bob Rudis
which(purrr::map_dbl(buylist, slot, "reqstock") > 100) or which(sapply(buylist, slot, "reqstock") > 100) ought to do the trick. On Mon, Oct 31, 2016 at 10:09 AM, Thomas Chesney wrote: > I have the following object > > setClass("buyer", >

Re: [R] The equivalent of which() when accessing slots in an object

2016-10-31 Thread Bob Rudis
ually > quicker than sapply(), uses less memory, gives the right results > when given a vector of length 0, and gives an error when FUN does > not return the specified sort of result. > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Oct 31, 2016

Re: [R] turning comma separated string from multiple choices into

2016-10-11 Thread Bob Rudis
Take a look at tidyr::separate() On Fri, Oct 7, 2016 at 12:57 PM, silvia giussani wrote: > Hi all, > > > > could you please tell me if you find a solution to this problem (in > Subject)? > > > > June Kim wrote: > >>* Hello,* > >> > >>* I use google docs' Forms to

Re: [R] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-17 Thread Bob Rudis
You can do something like: https://www.simple-talk.com/sql/performance/collecting-performance-data-into-a-sql-server-table/ and avoid the R step. Let the log perf data directly. On Mon, Oct 17, 2016 at 6:03 AM, jim holtman wrote: > within the VBS script you can easily access

Re: [R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread Bob Rudis
Having worked in big pharma for over 10 years, I'm _fairly_ certain AstraZeneca can afford some paid R consulting. On Fri, Oct 14, 2016 at 2:14 PM, David Winsemius wrote: > >> On Oct 14, 2016, at 12:05 AM, Vijayakumar, Sowmya >>

Re: [R] Match ISO 8601 week-of-year numbers to month-of-year numbers on Windows with German locale

2017-01-12 Thread Bob Rudis
Aye, but this: some_dates <- as.POSIXct(c("2015-12-24", "2015-12-31", "2016-01-01", "2016-01-08")) (year_week <- format(some_dates, "%Y-%U")) ## [1] "2015-51" "2015-52" "2016-00" "2016-01" (year_week_day <- sprintf("%s-1", year_week)) ## [1] "2015-51-1" "2015-52-1" "2016-00-1"

[R] [R-pkgs] New package: epidata

2017-01-13 Thread Bob Rudis
Hey folks, epidata — https://cran.r-project.org/package=epidata — hit CRAN a few days ago. It provides tools to retrieve Economic Policy Institute data library extracts from their "hidden"-but-well-conceived API, returning pristine data frames. EPI provides researchers,

[R] [R-pkgs] New CRAN Package Announcement: splashr

2017-08-30 Thread Bob Rudis
I'm pleased to announce that splashr is now on CRAN: https://CRAN.R-project.org/package=splashr The package is an R interface to the Splash javascript rendering service. It works in a similar fashion to Selenium but is fear more geared to web scraping and has quite a bit of power under the hood.

Re: [R] [FORGED] Re: Regarding R licensing usage guidance

2019-07-27 Thread Bob Rudis
Hey Anamika, I only caught the tail end of what became an off-topic thread, but backed up a bit to your original q. If I'm duplicating anything previous, apologies. If you are going to ship your "product" to end users directly (vs provide via an API or web application) I'm not sure how you get

Re: [R] Package httr::GET() question

2020-02-22 Thread Bob Rudis
curl::curl_escape() — https://github.com/jeroen/curl/search?q=curl_escape_q=curl_escape — uses the underlying libcurl curl_easy_escape() which does proper escaping b/c it's, well, curl. {httr} uses curl::curl_escape() — https://github.com/r-lib/httr/search?q=curl_escape_q=curl_escape The use