similar to: How to source() a .R file which was saved using UTF-8 encoding on Windows?

Displaying 20 results from an estimated 10000 matches similar to: "How to source() a .R file which was saved using UTF-8 encoding on Windows?"

2008 Oct 13
1
Running R at a specific time - alternative to Sys.sleep() ?
Dear R-Help, Is it possible to set R up to run a particular script at specific times of the day? trivial example: If the time is now 8:59:55am and I wish to run a function at 9am, I do the following: my.function <- function(x) { p1 <- proc.time() Sys.sleep(x) print('Hello R-Help!') proc.time() - p1 } my.function (5) [1] "Hello R-Help!" user system
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
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);
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,
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
2011 Mar 03
1
sqlFetch (RODBC) question
Dear all, I've used RODBC a lot to read in files created in MS excel and access but found a strange problem today: a variable in my data file contained both numbers and text; sqlFetch would set text within a row of numbers to NA; but if first 5 or 6 rows would be text then all numbers would be read in as NA. con<-odbcConnectExcel("xample.xls") #the file is attached or at
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 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 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 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 Mar 26
0
Locale problem between WinXP and Ubuntu
Hi R list, I have a peculiar problem in trying to Sweave a document in Ubuntu. The error message I get is the following: Error in gsub("\\n", "_", dd_name_level_nominal[k, 1], perl = TRUE) : input string 1 is invalid in this locale dd_name_level_nominal[k, 1] is a character object. I initially read these characters from a csv file which I create in Excel 2007. I have
2010 Mar 18
1
How to read.table with “Hebrew” column names (in R)?
(I am reposting this question after a few months without a solution...) Hi all, I am trying to read a .txt file, with Hebrew column names, but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And tried the command: read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t") This returns me with: X.....ª X...ª......
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
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
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],
2010 Jan 28
0
LMS estimation for lmsqreg package
Hello, I'm trying to create birth centile charts from about 90000 birth weights using the package lmsqreg. As this is not a CRAN package I have problems finding any examples, which explain how to estimate the LMS parameters needed for the equivalent degrees of freedom. (I only have some basic understanding of statistics, I roughly understand the formulas, but then I don't know how to
2009 Jan 15
2
Interface to open source Reporting tools
Hi, I am a new user of R 2.8.1. I use Tinn-R for code editing. I use a windows 2003 system with 1 GB RAM. I am interested to generate dashboard and reports based on data from MS Access. These reports need to be posted on a weekly basis to the web. The reporting interface should provide facilities for "what if" scenarios. Is it possible to interface R analysis results to good open
2017 Jun 23
0
LC_TIME not set correctly by Sys.setlocale() ?
On 23/06/2017 15:35, Joris Meys wrote: > 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(),
2011 Feb 14
1
readPNG gives warnings and doesn't execute sample code from help files
Dear all, I noticed in the latest R version (R.2.12.1) that the readPNG gives following warning when running the example code in the help file (or when using any other png for that matter) : 50: In rasterImage(img, 1.2, 1.27, 1.8, 1.73) : Per-pixel alpha not supported on this device No picture is shown, and code I used to be able to run, doesn't run any more. > sessionInfo() R version