Re: [R] Merge sort

2016-04-19 Thread Duncan Murdoch
;- c(result, x1, x2) result } If I were going for speed, I wouldn't modify the x1 and x2 vectors, and I'd pre-allocate result to the appropriate length, rather than growing it in the while loop. But that was a different class! Duncan Murdoch __ R-

Re: [R] Mean of hexadecimal numbers

2016-04-16 Thread Duncan Murdoch
On 16/04/2016 12:33 PM, Atte Tenkanen wrote: Hm..., Should these two versions produce the same solution? I wouldn't expect them to. Duncan Murdoch Unfortunately and shame to confess, I don't know much about the colors in R: myColors <- c("#FF7C00","#00BF40",&q

Re: [R] Mean of hexadecimal numbers

2016-04-16 Thread Duncan Murdoch
ird by taking the 2nd of a 4 colour palette, so x # gets twice the weight colorRampPalette(c(x, "#00"), space = "Lab")(4)[2] Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz

Re: [R] Bug in by() function which works for some FUN argument and does not work for others

2016-04-15 Thread Duncan Murdoch
rizzo/Rx/Rx-errata.txt. They corrected "mean" to "colMeans". Duncan Murdoch by(data=brain[, -1], INDICES=brain$Gender, FUN=mean, na.rm=TRUE) brain$Gender: Female FSIQ VIQ PIQ Weight Height MRI_Count 111.900 109.450 110.450 137.200 65.765 862654.600

Re: [R] Documentation: Was -- identical() versus sapply()

2016-04-12 Thread Duncan Murdoch
and see what can be done about getting a framework set up to work on one of those documents. JN On 16-04-12 10:52 AM, Duncan Murdoch wrote: > On 12/04/2016 9:21 AM, ProfJCNash wrote: >> >>>> "The documentation aims to be accurate, not necessarily clear." >>

Re: [R] Documentation: Was -- identical() versus sapply()

2016-04-12 Thread Duncan Murdoch
On 12/04/2016 12:44 PM, David Winsemius wrote: > On Apr 12, 2016, at 8:31 AM, Sarah Goslee wrote: > > I am very interested in such a distributed documentation editing > project, and have some thoughts on how to make it workable for both > volunteers and core members who

Re: [R] Documentation: Was -- identical() versus sapply()

2016-04-12 Thread Duncan Murdoch
I'll volunteer to participate in the approval and committing stage, but at first only for pages that I authored. If it turns out to be an efficient way to improve docs, then I'd consider other pages too. Duncan Murdoch __ R-help@r-project.org ma

Re: [R] [FORGED] Re: [FORGED] Re: identical() versus sapply()

2016-04-12 Thread Duncan Murdoch
On 11/04/2016 11:34 PM, Rolf Turner wrote: On 12/04/16 14:45, Duncan Murdoch wrote: On 11/04/2016 10:18 PM, Bert Gunter wrote: "The documentation aims to be accurate, not necessarily clear." !!! I hope that is not the case! Accurate documentation that is confusing is not very u

Re: [R] formula argument evaluation

2016-04-12 Thread Duncan Murdoch
t is not a legal R statement, so the parser signals an error. If you want to pass arbitrary strings to a function, you need to put them in quotes. Duncan Murdoch The addition sign "+" hasn't been evaluated, and I was hoping the "=" would not get evaluated either. Th

Re: [R] [FORGED] Re: identical() versus sapply()

2016-04-11 Thread Duncan Murdoch
. That is different than saying 'as(x, "numeric") is the same as as.numeric(x)'. Duncan Murdoch I understand that it is challenging to write docs that are both clear and accurate; but I hope that is always the goal. Cheers, Bert Bert Gunter "The trouble with having an open mi

Re: [R] [FORGED] Re: identical() versus sapply()

2016-04-11 Thread Duncan Murdoch
mance is not always simple and easy to predict, but I think anyone who had experience with R would never use as(x, "numeric"). So this just isn't a problem worth fixing. Now, you might object that the documentation claims they are equivalent, but it certainly doesn't. The documentatio

Re: [R] what is the faster way to search for a pattern in a few million entries data frame ?

2016-04-10 Thread Duncan Murdoch
/blogs or suggestion that can give me some guidance ? Didn't you post the same question yesterday? Perhaps nobody answered because your question is unanswerable. You need to describe what the strings are like and what the patterns are like if you want advice on speeding things

Re: [R] How to print the graphs in landscape/portrait orientation

2016-04-09 Thread Duncan Murdoch
unusable. - Do post self-contained examples. Even if I spent the time to edit your post into something I could run, it would fail, because I don't have copies of all the variables it uses. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUB

Re: [R] Arguments to utils:::menuInstallPkgs

2016-04-09 Thread Duncan Murdoch
using winMenuAddItem). Duncan Murdoch For example: > utils:::menuInstallPkgs(loc=.libPaths()[2]) > utils:::menuInstallLocal(loc=.libPaths()[2]) Thanks, ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\ Jose Claudio Faria Estatistica UESC/DCET/Brasil joseclaudio.faria at gmail.com Telefon

Re: [R] [FORGED] Re: identical() versus sapply()

2016-04-09 Thread Duncan Murdoch
nt it as floating point, write it as 1. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

Re: [R] R.squared in summary.lm with weights

2016-04-08 Thread Duncan Murdoch
re expecting consistency where there needn't be any. Why do you see an inconsistency here? Those are different calculations. You get expressions like these if you assume observations have variance sigma^2/w, and you're trying to estimate sigma^2. Du

Re: [R] Question about R Ver.2.7.2 compatible with JAVA 8

2016-04-07 Thread Duncan Murdoch
with JAVA 8? R 2.7.2 is very old --- it was released nearly 8 years ago. I think you're going to have to do the testing yourself, unless you're very lucky that someone remembers. Duncan Murdoch Regards Thirumurugan Rajamoorthy |thirumurugan.rajamoorthy...@otsuka-us.com

Re: [R] HTML help -- as a single document for the entire package

2016-04-06 Thread Duncan Murdoch
to loop over all of them; it would also need to handle links between topics differently than it currently does, because some of them would be internal links, others would be external. The source for the function is in https://svn.r-project.org/R/trunk/src/library/tools/R/Rd2HTML.R. Duncan Murdoch

Re: [R] HTML help -- as a single document for the entire package

2016-04-06 Thread Duncan Murdoch
window size - no page breaks - full text search across the entire manual. No, there isn't. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] File 1 is not in sorted order Error

2016-04-05 Thread Duncan Murdoch
ce. Set the environment variable LC_COLLATE equal to C. Some parts of the R build system do this, and some parts use your locale's collation sequence. You need to make sure they're all consistent. Duncan Murdoch __ R-help@r-project.org mailing list -- To U

Re: [R] Fwd: as.Date gives NAs when transforming from factor

2016-04-05 Thread Duncan Murdoch
ly want a$Date <- as.Date(a$Date, format = "%d/%m/%Y") Duncan Murdoch Posible Solutions: I’ve read here that it has to do with the Sys Locale, and the solution was using: “LC_TIME”, “C”. But I didn’t have success. http://stackoverflow.com/questions/15566875/as-date-returning

Re: [R] Extending the beta period for R 3.3.0 till April 25, Final release on May 3

2016-04-04 Thread Duncan Murdoch
://cran.rstudio.com/bin/windows/base/rtest.html Duncan Murdoch ___ r-annou...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-announce __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] p values from GLM

2016-04-01 Thread Duncan Murdoch
On 01/04/2016 6:46 PM, Bert Gunter wrote: ... of course, whether one **should** get them is questionable... They're just statistics. How could it hurt to look at them? Duncan Murdoch http://www.nature.com/news/statisticians-issue-warning-over-misuse-of-p-values-1.19503#/ref-link-1

Re: [R] p values from GLM

2016-04-01 Thread Duncan Murdoch
an) give a matrix? Then it's colnames(summary(fitwean)$coefficients) you want, not names(fitwean). Duncan Murdoch P.S. If you had given a reproducible example, I'd try it myself. > > Thank you! > John > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostat

Re: [R] R logo size in package information tab of Rstudio

2016-03-30 Thread Duncan Murdoch
an older version of it). I'm not completely up to date on RStudio, so it may be that you can fix it by updating. I've bcc'd support at RStudio to let them know about this; not sure if that will get through. Duncan Murdoch __ R-help@r-project.org mailing

Re: [R] Accented characters, windows

2016-03-29 Thread Duncan Murdoch
me point in the future the internal character handling in R needs an overhaul, but that's a really big, really thankless job. Perhaps Microsoft/Revolution will donate some programmer time to do it, but more likely, it will wait for volunteers in R Core to do

Re: [R] R logo size in package information tab of Rstudio

2016-03-29 Thread Duncan Murdoch
is RStudio relevant here? I don't think RStudio does anything with the R help files other than to display them in its built-in browser. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo

Re: [R] Fwd: question on constrOptim

2016-03-24 Thread Duncan Murdoch
figure out the problem, simplify things enough to post to R-help, and post it there. It needs to be in a form that someone else can run. (Don't email it just to me, send it to the list.) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUB

Re: [R] How to make a function aware of its own call arguments

2016-03-24 Thread Duncan Murdoch
you aware of any function what would query the original function call arguments no matter what happens in the function? The match.call() function does that, but I think you don't need that: f <- function(x = 1, ...) { x <- 2 match.call() } f(3) ## Prints: f(x = 3) Duncan Murdoch Sebastie

Re: [R] adding points in plot loop

2016-03-23 Thread Duncan Murdoch
m; if later points fall outside the plot area, they won't be shown. So you may need to work out xlim and ylim in advance. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinf

Re: [R] R studio kniter

2016-03-22 Thread Duncan Murdoch
I would write something like this: knit("texfile.rnw") That exact command works. It will produce a .tex file; if you want to continue on to produce a PDF, you need knit2pdf("texfile.rnw") instead. Duncan Murdoch __ R-help@r-pr

Re: [R] Persistent state in a function?

2016-03-21 Thread Duncan Murdoch
ts environment remains as the environment of f That's not quite the jargon we use. The environment of g would probably be the global environment. The thing that gets left behind is the evaluation frame (or environment) of the call g(). Its parent environment is the environment of g. Duncan

Re: [R] Please guide -- Error during export in csv format

2016-03-21 Thread Duncan Murdoch
ames in Windows. This is a limitation of the way R handles non-ASCII characters in Windows, and there's not much you can do about it other than avoiding characters which do not display in Latin1 (or whatever R sees as your native character set). Duncan Murdoch ___

Re: [R] How to reach the column names in a huge .RData file without loading it

2016-03-19 Thread Duncan Murdoch
ortable textual format. JSON is close, but it can't handle the full range of data that R can handle (e.g. no Inf). dput() on a dataframe is text, but nothing but R can read it. Duncan Murdoch Best regards, Jan P.S.: I've seen .RData images containing many months worth of interactive work, and mu

Re: [R] Persistent state in a function?

2016-03-19 Thread Duncan Murdoch
mple(1:3, 2) print(sprintf("d(%d, %d) = %f", x[1], x[2], myDist(x[1], x[2]))) } Use local() to create a persistent environment for the function. For example: f <- local({ x <- NULL function(y) { cat("last x was ", x, "\n") x <

Re: [R] Truncated file upon reading a text file with 0xff characters

2016-03-15 Thread Duncan Murdoch
readLines; read.table is much more complicated, and isn't necessary to illustrate the problem. It just confuses things by bringing it into the discussion. You should also avoid bringing text mode connections into the discussion unless they are necessary. Duncan Murdoch On 15/03/2016 3:0

Re: [R] doubt clarification

2016-03-15 Thread Duncan Murdoch
e(all.2015$Day, "%d-%m-%y") (and be careful of the quotes: these are regular ASCII quotes, not directional quotes which some editors will insert). Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://s

Re: [R] Utils - View mode - Filter

2016-03-13 Thread Duncan Murdoch
it to work with another system, such as the host MacOS. I wouldn't be surprised if View() used to run something like edit(). So the OP and David should update their RStudio. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] specify size of box around legend

2016-03-11 Thread Duncan Murdoch
On 11/03/2016 9:50 AM, Rainer M Krug wrote: Duncan Murdoch <murdoch.dun...@gmail.com> writes: > On 11/03/2016 9:01 AM, Rainer M Krug wrote: >> Hi >> >> assume the following code: >> >> --8<---cut here---start->8-

Re: [R] specify size of box around legend

2016-03-11 Thread Duncan Murdoch
L 1 and L 3 have the same height? You can add blank entries as fillers to L 1. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

Re: [R] Functional programming?

2016-03-02 Thread Duncan Murdoch
On 02/03/2016 11:47 AM, Roger Koenker wrote: I have a (remarkably ugly!!) code snippet (below) that, given two simple functions, f and g, generates a list of new functions h_{k+1} = h_k * g, k= 1, …, K. Surely, there are vastly better ways to do this. I don’t particularly care about the

Re: [R] Version 3.2.3: package not available error with https

2016-02-29 Thread Duncan Murdoch
build, e.g. possibly an out of date or missing libcurl. What does capabilities("libcurl") say? Duncan Murdoch Warning message: package ‘RCurl’ is not available (for R version 3.2.3) If I choose the menu entry "(HTTP mirrors)" I get the list of HTTP mirrors with which I

Re: [R] Annoying startup error message

2016-02-26 Thread Duncan Murdoch
uot;/Users/lars/Downloads/spark-1.6.0-bin-hadoop2.6/bin/spark" Sys.unsetenv("SPARK_HOME") Sys.getenv("SPARK_HOME") [1] "" R doesn't look at that variable, so that would not be the cause. Duncan Murdoch Thanks again for you help! Lars. On Fri, Feb 26, 2016

Re: [R] Annoying startup error message

2016-02-26 Thread Duncan Murdoch
. Duncan Murdoch Sarah On Fri, Feb 26, 2016 at 12:01 PM, Lars Bishop <lars...@gmail.com> wrote: > Thank you Ulrik. I actually don't want to install SparkR, just don't want > to have that error message when R starts. For some reason, R is trying to > load the package every

Re: [R] distribution freq

2016-02-26 Thread Duncan Murdoch
have a huge interval from 96 fo 4. If I put diff(pgamma(c(96,8), shape, rate)) I obtaining the same values for all classes. Please post some sample data and the calculations you're trying to do. (And please try to post in plain text; code tends to be unreadable if posted in HTML.) Duncan

Re: [R] formatting expressoion(paste with line shift

2016-02-26 Thread Duncan Murdoch
On 26/02/2016 7:37 AM, Duncan Murdoch wrote: On 26/02/2016 7:08 AM, Troels Ring wrote: (pHi <- seq(1,8)) #This gets formatted well but I want subscript for 2 in pCO2 plot(pHi,type="s",axes=FALSE,xlab="",lwd=4, main=paste("Theoretical experiment using SID = 0

Re: [R] distribution freq

2016-02-26 Thread Duncan Murdoch
, you want differences in the cumulative probability. So if your class runs from 4 to 8 cm, use something like pgamma(8, shape, rate) - pgamma(4, shape, rate) or the equivalent but a little obscure diff(pgamma(c(8, 4), shape, rate)) Duncan Murdoch P.S. Please keep discussion on the mailing list

Re: [R] formatting expressoion(paste with line shift

2016-02-26 Thread Duncan Murdoch
ot;") mtext(expression(paste("Theoretical experiment using ", pCO[2], "= 40")), 3, line = 3) mtext("SID = 0.13 M", 3, line = 2) mtext("ATOT = 0.2 M and pKa = 6.8", 3, line = 1) You can move things around by changing the "line = " args, and ad

Re: [R] getDLLRegisteredRoutines

2016-02-25 Thread Duncan Murdoch
cluded in the Rtools collection. (I usually use pedump; I forget whether nm works on .dll files, or only .so files.) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Scaling x axis

2016-02-25 Thread Duncan Murdoch
, i want to see every point with the respectively date in the axis. How can I do that? Plot it with axes = FALSE, and then add each axis using the Axis() (or axis() or axis.Date() or...) function. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] distribution freq

2016-02-25 Thread Duncan Murdoch
to do here. Could you put together a short example showing what input you have and what output you'd like? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Double AND within an IF statement

2016-02-24 Thread Duncan Murdoch
On 24/02/2016 11:27 AM, Bert Gunter wrote: I would have assumed that age, etc. were vectors; but that's why I said "almost" surely. Okay, so you were confusing if () with ifelse(). Duncan Murdoch -- Bert Bert Gunter "The trouble with having an open mind is that people ke

Re: [R] Double AND within an IF statement

2016-02-24 Thread Duncan Murdoch
On 24/02/2016 11:18 AM, Bert Gunter wrote: Almost surely no. You are confusing "&&" with "&" ?"&" I think Bob had it right... Duncan Murdoch -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along

Re: [R] readRDS problem

2016-02-24 Thread Duncan Murdoch
allowed to change things there. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

Re: [R] Query in R.

2016-02-23 Thread Duncan Murdoch
. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] .Internal(La_rs(x, FALSE)) crashes R after long (reproducible) script on windows only

2016-02-23 Thread Duncan Murdoch
that doesn't use any contributed packages. If you can't leave out the packages, try to reduce it to just one, and ask the maintainer of that package about it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch
th horizontal lines and customized text inserted at the beginning of a group.. If you wanted LaTeX output, you could do this like the example at the end of section 2.1.5 in the vignette. (You might want to combine that with subsetting as in section 3.3.) Duncan Murdoch \begin{tabular}{l} \hl

Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch
cies + 1) ~ (n=1) + Format(digits=2)* (Sepal.Length + Sepal.Width)*(mean + sd), data=iris ) html(tab) ``` Duncan Murdoch On Mon, Feb 22, 2016 at 12:17 PM, Santosh <santosh2...@gmail.com> wrote: Dear Rxperts.. I am able to generate tables using Tables R package.. However, when I have been u

Re: [R] Trying to load a FORTRAN dll but unable

2016-02-22 Thread Duncan Murdoch
n your own. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Trying to load a FORTRAN dll but unable

2016-02-22 Thread Duncan Murdoch
ee "Platform: i386-w64-mingw32/i386 (32-bit)" in the startup banner, and you need a 32 bit DLL. If you are running 64 bit R, you'll see "Platform: x86_64-w64-mingw32/x64 (64-bit)", and you need a 64 bit DLL. 32 bit Windows can only run 32 bit R, bu

Re: [R] 'tcltk' in R2.3.3

2016-02-18 Thread Duncan Murdoch
On 18/02/2016 3:03 PM, Divakar Reddy wrote: Dear R users, I would to install 'tcltk' in R2.3.3 but getting below error when I tried to install. Can you please suggest me? Don't try to install a base package. You already have it. You aren't allowed to update it. Duncan Murdoch

Re: [R] cannot install stats package

2016-02-18 Thread Duncan Murdoch
? The stats package is a base package. It is part of R, you don't need to install it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Convert list to data frame

2016-02-15 Thread Duncan Murdoch
;) Or you can look at class(Data). Duncan Murdoch When I tried as.data.frame(unlist(Data)) The Data converted to a vector not to a data frame. Any idea ? Thank you in advance __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https:

Re: [R] R 3.2.3 on Win8; mkdir command produces error

2016-02-14 Thread Duncan Murdoch
the name; you probably need dir.create("specdata") Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] Installing Rstudio Addinexamples

2016-02-10 Thread Duncan Murdoch
mples/zipball/masterError in curl::curl_fetch_memory(url, handle = handle) : Timeout was reached You'll need to ask RStudio this. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/li

Re: [R] Shiny

2016-02-10 Thread Duncan Murdoch
about it. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] middle of interval

2016-02-08 Thread Duncan Murdoch
uot;, interval)) stop <- as.numeric(sub(".*-", "", interval)) (start + stop)/2 Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] Setting directory in Windows

2016-02-07 Thread Duncan Murdoch
t the current directory to the one with your files in it, using a old-fashioned Windows dialog box. If things stop working the way you expect, run getwd() to get R to print what's the current directory. 4. You can also use file.choose() to use Windows dialogs to pick a file; then it do

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
arguments to the list() function, which constructs a list containing them. as.list() doesn't want a bunch of arguments, it will just ignore most of them. Duncan Murdoch for( i in 1:length(list1) ) cat( "i is ", list1[[i]], "\n" ) return (0) } I

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
On 07/02/2016 7:14 PM, Ben Tupper wrote: Hi, On Feb 7, 2016, at 6:24 PM, Duncan Murdoch <murdoch.dun...@gmail.com> wrote: On 07/02/2016 6:12 PM, Robert Sherry wrote: I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pr

Re: [R] Plot step function

2016-02-06 Thread Duncan Murdoch
accurate approach would be to work out the coordinates of the endpoints and two corners in the appropriate order, and join them by lines. For example, plot(c(-2,0,0,2), c(0,0,1,1), type="l") In either case you'll probably want to change axis labels using xlab or ylab argument

Re: [R] does save.image() also save the random state?

2016-02-05 Thread Duncan Murdoch
ent results of sample(10) every time after loading the saved image? This happens because you are reloading the random number seed. You can tell R to ignore it by calling set.seed(NULL) just after you load the image. See ?set.seed for more details. Duncan Murdoch

Re: [R] does save.image() also save the random state?

2016-02-05 Thread Duncan Murdoch
On 05/02/2016 11:49 AM, Dénes Tóth wrote: On 02/05/2016 05:25 PM, Duncan Murdoch wrote: > On 05/02/2016 11:14 AM, Jinsong Zhao wrote: >> Dear there, >> >> Here is a snipped code, >> >> > rm(list = ls()) >> > x <- 123 >> > s

Re: [R] Paste Funtion Help

2016-02-04 Thread Duncan Murdoch
wo into one and name as name however I can getting an error: Error in `[.data.frame`(merge.salaries, , `:=`(name, paste("nameFirst", : could not find function ":=" It looks as though you're using syntax defined by the data.table package, but you don't have it attache

Re: [R] Create macro_var in R

2016-02-03 Thread Duncan Murdoch
have it return the modified version. For example, population <- doModifications(population) where doModifications is a function with a definition like doModifications <- function(MAVR) { # do all your calculations on MAVR # then return it at the

Re: [R] Create macro_var in R

2016-02-03 Thread Duncan Murdoch
t that column into a separate variable, and work with that, either as MVAR <- tab$population or tab$population <- doModifications(tab$population) following the same patterns as below. Duncan Murdoch On Wednesday, February 3, 2016 11:54 AM, Duncan Murdoch <murdoch.dun...@gmail

Re: [R] Big Finance and digits

2016-02-02 Thread Duncan Murdoch
do that.) At the end when you want to print, you need to convert to character. You can use options(digits=) to set the default number of digits, or you can do the conversion explicitly, using format(), sprintf(), or a related function. It's up to you how many decimals you print. Duncan

Re: [R] as(, "numeric") vs as.numeric()

2016-02-01 Thread Duncan Murdoch
On 01/02/2016 10:00 AM, Erik Wright wrote: Dear Frank, Thank you for the quick response. I am familiar with the tradeoffs between integers and doubles. However, I do not believe this answers my question. If you look at the help information for the as() function it says: "as(x, "numeric")

Re: [R] R Studio error while installing twitteR package

2016-01-31 Thread Duncan Murdoch
e40/site-library/twitteR" does not have an MD5 file, so integrity check was not doneCOULD NOT CHECK MD5 CHECKSUMS* I think you'll need to contact either RStudio or Tibco support for this. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] Error in loading caret

2016-01-29 Thread Duncan Murdoch
install? What version of R are you using? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htm

Re: [R] on specifying an encoding for plot's main-argument

2016-01-29 Thread Duncan Murdoch
n the EMACS modeline. It means I'm encoding in UTF-8. I tried '1', ISO-8859-1, also called Latin-1.) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] String Matching

2016-01-29 Thread Duncan Murdoch
2rx(paste(cusip, ".*", ".rds"), trim.head = TRUE, trim.tail = TRUE) This returns false which leads me to believe that it is not working No, it returns a regular expression. You need to tell us what you really did if you want help fixing it. Duncan Murdoch glob2rx(paste(cus

Re: [R] Error : there is no .Internal function 'par'

2016-01-27 Thread Duncan Murdoch
of par() from some earlier version of R. Perhaps you called edit() on it and saved a copy? The current one doesn't call .Internal. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo

Re: [R] R-help mailing list activity / R-not-help?

2016-01-26 Thread Duncan Murdoch
on a tangent that has nothing to do with questions or answers. There are also threads like this one that contain no questions or answers, and are just full of hot air. Thanks for posting the link. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] How do I parse embedded quotes?

2016-01-26 Thread Duncan Murdoch
double quotes that are within the string are not escaped. To be legal R code you would need "'\"a\"'" and to get that you need the original string to look like "\"'\\\"a\\\"'\"" Duncan Murdoch __ R-help@r-project.o

Re: [R] R tool downloaded

2016-01-26 Thread Duncan Murdoch
be local. I don't know about your country, but in many places, 0 - Cloud works really well. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Downloading Google finance data onto R

2016-01-26 Thread Duncan Murdoch
quot; on Yahoo. Google appears to have changed its interface, so src = "google" doesn't work. You will probably have to manually download the Google history, or debug and fix getSymbols.google in quantmod. Duncan Murdoch __ R-help@r-proje

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch
all I see is people being mean and nothing much else happening. Why would you bother to read it if that's all you see? I think there are examples of posts here which are not at all helpful, and others which are rude, but the majority are actually helpful (even some of the rude ones). Duncan

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch
to flame wars than to improved behaviour. As others have suggested, if you think someone has been mistreated, then the public remedy should be to treat them well by giving a better answer yourself. Duncan Murdoch On the other hand noting that the list is not intended to be a source

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch
us posted a more helpful response when we saw a rude, unhelpful one. Duncan Murdoch On 25 January 2016 at 12:07, Duncan Murdoch <murdoch.dun...@gmail.com> wrote: > On 25/01/2016 2:45 PM, Oliver Keyes wrote: > >> I disagree, and would argue that fails to take a systemic view

Re: [R] R-help mailing list activity

2016-01-23 Thread Duncan Murdoch
questions on the mailing lists, but ask more on Stackoverflow. I think this is due to my original point: the experts in the topics I'm asking about are more likely to be there than here. Duncan Murdoch P.S. Your statistics are a little misleading: you counted threads in one R mailing list i

Re: [R] R-help mailing list activity

2016-01-23 Thread Duncan Murdoch
One additional point: On 23/01/2016 8:33 AM, Duncan Murdoch wrote: distinction between answers and comments, it's gamification (badges, One advantage of Stackoverflow is that you can go back and correct silly errors (like misspelling "its"). Dunc

Re: [R] Lists heading in an array of lists in R

2016-01-22 Thread Duncan Murdoch
ning your list to the element using TunePar[[1,1]] <- list(G=2) At this point, TunePar[1,1] is a list containing list(G=2): it prints as [[1]] [[1]]$G [1] 1 To get the result you want, you also need to access the element instead of the subset: TunePar[[1,1]] will print $G [1] 1 Du

Re: [R] R editor for Mac

2016-01-21 Thread Duncan Murdoch
On 20/01/2016 1:28 PM, Duncan Murdoch wrote: On 20/01/2016 1:22 PM, Christofer Bogaso wrote: > Hi, > > Could you please suggest a good R editor for Mac OS X (10.7.5) > Previously my operating system was Windows and there I used Notepad++, > I really had very nice experience wit

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
. - The editor still changes file endings to native format whenever it saves. It would be better if it handled both Windows and Unix line endings in both systems, and left them alone unless the user asked them to be changed. The positives are too numerous to list here. Duncan Murdoch

Re: [R] Simple syntax question (I think)

2016-01-20 Thread Duncan Murdoch
st case there's no referenced variable, just an expression vector("numeric",2), so you get the error, just as you would with vector("numeric",2) <- c(0, 3) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
hecking hints in the editor (not just for R, for some other languages too). I think Emacs + ESS matches (exceeds if you count non-R stuff) RStudio in functionality, but it is much harder to learn. Duncan Murdoch __ R-help@r-project.org mailing list -- T

Re: [R] tikzDevice and Sweave

2016-01-18 Thread Duncan Murdoch
to <>= library(tikzDevice) # added height and width tikz(file = "tikzFig.tex", width = 4, height = 3) plot(sin, -pi, 2*pi, main = "A stand alone TikZ plot", xlab = "x", ylab = "sin(x)") dummy <- dev.off() cat("\\input{tikzFig.tex}") @ As

Re: [R] tikzDevice and Sweave

2016-01-17 Thread Duncan Murdoch
're using knitr, see the discussion of dev = "tikz" in <http://yihui.name/knitr/>. If you're using Sweave, you probably need pgfSweave. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.et

Re: [R] tikzDevice and Sweave

2016-01-17 Thread Duncan Murdoch
On 17/01/2016 3:40 PM, Duncan Murdoch wrote: On 17/01/2016 3:25 PM, Naresh Gurbuxani wrote: I want to use tikz() function in tikzDevice package so that it generates a pdf file to be included in the bigger tex file. Below code works, but directly inserts tikz commands in the output tex file

<    5   6   7   8   9   10   11   12   13   14   >