similar to: Running R at a specific time - alternative to Sys.sleep() ?

Displaying 20 results from an estimated 10000 matches similar to: "Running R at a specific time - alternative to Sys.sleep() ?"

2008 Oct 06
3
Extracting text from html code using the RCurl package.
Dear R-help, I want to download the text from a web page, however what i end up with is the html code. Is there some option that i am missing in the RCurl package? Or is there another way to achieve this? This is the code i am using: > library(RCurl) > my.url <- 'https://stat.ethz.ch/mailman/listinfo/r-help' > html.file <- getURI(my.url, ssl.verifyhost = FALSE,
2008 Nov 04
2
How to suppress errors from htmlTreeParse() function in XML package?
Dear R-help, The following code downloads an html document into variable 'doc' and then stores an internal representation into variable 'html.tree'. Even if the html code is malformed, this still works which is fantastic. However, as in the example below, i do get some ouput from R in the console which i would like to suppress somehow, so i can keep my window a bit cleaner. I
2008 Nov 13
1
readPDF() -- unsure how to install xpdf to make this work?
Dear R-Help, I need to convert a set of '.pdf' files into an equivalent set of '.txt' files. This is so that i can do some text mining on the content. In the latest R-News letter (http://cran.r-project.org/doc/Rnews/ Rnews_2008-2.pdf), the package 'tm' for text mining is mentioned. In that lovely package, there is a function called 'readPDF()'. In order to use
2010 May 06
2
reading formatted txt file into a data frame
Dear all Lets say I have a plain text file as follows: > cat(c("[ID: 001 ] [Writer: Steven Moffat ] [Rating: 8.9 ] Doctor Who", + "[ID: 002 ] [Writer: Joss Whedon ] [Rating: 8.8 ] Buffy", + "[ID: 003 ] [Writer: J. Michael Straczynski ] [Rating: 7.4 ] Babylon [5]"), + sep = "\n", file = "tmp.txt") I would somehow like to read
2009 Sep 07
2
using an array of strings with strsplit, issue when including a space in split criteria
Dear all, I'm having a problem understanding why a split does not occur with in the 2nd use of the function strsplit below: # text strings > txt <- c("sales to 23 August 2008 published 29 August", + "sales to 6 September 2008 published?11 September") # first use > strsplit(txt, 'published', fixed=TRUE) [[1]] [1] "sales to 23 August 2008 "
2009 Oct 05
1
How to get NA's into the output of xtabs?
Dear all, Lets say I have the following data frame: > df1 <- data.frame(Show=c('Star Trek', 'Babylon 5', 'Dr Who'), Size=c(0.7, 0.0, 0.701), Date=as.Date(c('2007-08-03', '2007-08-03', '2007-08-03'), format='%Y-%m-%d')) > df2 <- data.frame(Show=c('Star Trek', 'Dr Who', 'Torchwood'), Size=c(0.8, 0.85,
2009 Feb 22
1
Filtering a data frame using a string for colum header
Hi all, I was just radomly playing with R and got the following error when trying to filter a data frame using a string: > Angel <- c(7,8,6,9,10) > Buffy <- c(8,9,4,9,10) > Firefly <- c(9,9,10,10,10) > DrHorrible <- c(10,9,9,10,10) > my.df <- data.frame(Angel, Buffy, Firefly, DrHorrible) > my.df["DrHorrible"] DrHorrible 1 10 2 9 3
2009 Oct 21
2
How to average subgroups in a dataframe? (not sure how to apply aggregate(..))
Dear all, Lets say I have the following data frame: > set.seed(1) > col1 <- c(rep('happy',9), rep('sad', 9)) > col2 <- rep(c(rep('alpha', 3), rep('beta', 3), rep('gamma', 3)),2) > dates <- as.Date(rep(c('2009-10-13', '2009-10-14', '2009-10-15'),6)) > score=rnorm(18, 10, 3) > df1<-data.frame(col1=col1,
2009 Jan 26
2
RCurl unable to download a particular web page -- what is so special about this web page?
Dear R-help, There seems to be a web page I am unable to download using RCurl. I don't understand why it won't download: > library(RCurl) > my.url <- "http://www.nytimes.com/2009/01/07/technology/business-computing/07program.html?_r=2" > getURL(my.url) [1] "" Other web pages are ok to download but this is the first time I have been unable to download a
2017 Jun 23
2
LC_TIME not set correctly by Sys.setlocale() ?
Related to the following question on Stackoverflow: https://stackoverflow.com/questions/44723690/unexpected-behavior-of-sys-setlocale#44723690 It appears as if Sys.setlocale() does not update LC_TIME correctly for use in date formatting. Although R reports that LC_TIME is changed to the new setting after use of Sys.setlocale(), as.Date() still uses the old settings. The only way to update this is
2009 Jun 02
1
Problem downloading webpages using batchfiles and RCurl from command line in Vista Basic - couldn't connect to host
Dear all, I am having a problem downloading webpages through R when i run it in the DOS window under Windows Vista Basic. I have downloaded the batchfiles from http://code.google.com/p/batchfiles/ and have successfully set the PATH. I open up 'Command Prompt' in Vista and type (after the C:\...> stuff): ### START ### C:\Users\Karen>Rscript -e "library(RCurl);
2009 Feb 18
1
Training nnet in two ways, trying to understand the performance difference - with (i hope!) commented, minimal, self-contained, reproducible code
Dear all, Objective: I am trying to learn about neural networks. I want to see if i can train an artificial neural network model to discriminate between spam and nonspam emails. Problem: I created my own model (example 1 below) and got an error of about 7.7%. I created the same model using the Rattle package (example 2 below, based on rattles log script) and got a much better error of about
2013 Feb 26
3
double bracket stripping names
Is it on purpose that `[[` strips the names when used on an atomic vector? > c(a=1, b=2)[1] a 1 > c(a=1, b=2)[[1]] [1] 1 > sessionInfo() R Under development (unstable) (2013-02-11 r61902) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United Kingdom.1252 [2] LC_CTYPE=English_United Kingdom.1252 [3] LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C
2010 Jan 20
1
Reshaping data with xtabs giving me 'extra' data
Dear all, Lets say I have several data frames as follows: > set.seed(42) > dates <- as.Date(c("2010-01-19", "2010-01-20")) > times <- c("09:30:00", "11:30:00", "13:30:00", "15:30:00") > shows <- c("Red Dwarf", "Being Human", "Doctor Who") > > df1 <- data.frame(Date = dates[1],
2009 Dec 17
2
Wrong links in help help files? (PR#14155)
Dear R developers, ?help.search ...opens a tab in my browser (Firefox 3.5.6, Win XP): http://127.0.0.1:31642/library/utils/html/help.search.html When I click on the link for "?", (http://127.0.0.1:31642/library/utils/help/?) in the last line of "Details", I get an error message: "Server error: invalid response from R". Similarly, The link to "??"
2012 Jun 06
1
error calling Winbugs using R2WinBugs to run a multi-level model
Dear all, I'm calling Winbugs (1.4.3) through R2WinBugs (2.1-18 coda_0.14-7) to fit a switching random walk model, but come up with an instant trap with the log only displaying 'check('. I will paste the trap with session info below; I'd be very grateful for any ideas. Couple of leads: 1. I presume the problem relates to the r package itself or the way I call bugs(), because I
2008 Apr 29
2
help text for xlim
Dear R-developers, A student asked me today of how to specify the limits of the x-axis. I knew that he should use xlim, but I tried to encourage him to have a try himself with the various help functions. I do not judge if he used the correct search strategy or right key words, but anyway here is what he tried: he looked at ?plot. There xlim is not mentioned. He checked ?par. There you find
2012 May 26
3
Problem with readHTMLTable
Hello All, i was trying to simply run the readHTMLTable on the example published in the package. And on a page I was working on. So running: u = "http://en.wikipedia.org/wiki/List_of_countries_by_population" tables = readHTMLTable(u) returns the following error: Error in tb[["thead"]] : subscript out of bounds looking up this error on the web, didnt give me any hint. Is
2008 Jun 10
2
Slow function
Hi, I have the following function that I want to apply to a list of 14 matrices (1536 x 170) of binary data: DRes <- function(x, nr = 10000, metric = "mixed", ...) { require(analogue) require(ade4) m <- c() for (i in 1:nr) { set.seed(i) x1 <- x[, sample(dimnames(x)[[2]], length(x[1,])/2)] x2 <- x[, !dimnames(x)[[2]] %in% dimnames(x1)[[2]]] d1 <-
2009 Apr 07
3
strange (?) behavoir of expand.grid()
Hello, I came across a strange behavior of expand.grid (or at least strange to me). For certain values of one of my input variables - created by seq() - I have to use strings (e.g ==".6") to select a row of the object created by expand.grid(), for other values numerical (e.g. ==.8) and for some both work. Please find an example below. #Example x<- seq(0,1,1/10) y <-