Re: [R] Alternatives for explicit for() loops

2015-11-01 Thread Duncan Murdoch
with your innermost loops, and vectorize those. Continue outwards from there if you can. For example, you have > for (i in 1:(m-1)) { >h[i]<- choose(x[i],LED[j,i]) >} which could be vectorized as

Re: [R] Creating "Envelope" around a plot

2015-11-02 Thread Duncan Murdoch
, and you use a really huge line width. For example, veca<-c(4,3,6,5,7,3,2,3,3,6,8,7)plot(veca, lwd=150, col="gray", type="l")lines(veca, lwd=2) If you want to be 1 unit away in user coordinates and the x and y scales are different, it will be a lot harder. Duncan M

Re: [R] Color & pch functionalities in dotchart()

2015-11-03 Thread Duncan Murdoch
ort.list(as.numeric(groups), decreasing = TRUE) tmp <- beaver1[o,] dotchart(tmp$temp, groups=factor(tmp$day), color=as.factor(tmp$activ), pch=tmp$activ) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https:

Re: [R] mysterious error message not sure if its from within package?

2015-11-05 Thread Duncan Murdoch
rred by listing the call stack at the time of the error. 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

Re: [R] A bunch of packages keeps wanting to get updated

2015-11-05 Thread Duncan Murdoch
g them to a personal library rather than the system one (to which you typically don't have write permission). You should be getting messages about this, but they might be hidden; if you run update.packages() it might be easier to see the messages. You can also try running .libPath

Re: [R] Trouble Installing R packages

2015-11-06 Thread Duncan Murdoch
On 05/11/2015 9:42 PM, Adam Garza wrote: Trying to install vcd package but can’t It seems like it tries but runs into some kind of error and so quits. Maybe it has something to do with the “dependencies” – not sure what that means Most packages depend on other packages. The vcd package depend

Re: [R] Dataframes - Integer and decimal in same column?

2015-11-06 Thread Duncan Murdoch
ter(1), as.character(1.1))) will display as y 1 1 2 1.1 If the numbers are already in the same column, you could do it as data.frame(z = sprintf("%g", c(1, 1.1))) Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIB

Re: [R] Advice collating an R package

2015-11-11 Thread Duncan Murdoch
u can list the files in the Collate field of your DESCRIPTION file if you want a different order; see Writing R Extensions for details). Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

Re: [R] Problems using save to store NAMED R objects

2015-11-12 Thread Duncan Murdoch
Do you have any comments on this? I believe do.call(save, list(as.name(nn), file = "f.RData")) should do what you want. There are probably other ways, maybe simpler ones. If you're interested, the theory here is that do.call() constr

Re: [R] Environment question

2015-11-13 Thread Duncan Murdoch
}) names(result)[y] <- paste("plus", y, sep = ".") } result } The "names" line is optional; with it, you can use f <- f.factory4() f$plus.2(2) but with or without it you can use f[[2]](2) Duncan Murdoch _

Re: [R] Suprising R behaviour

2015-11-13 Thread Duncan Murdoch
though you have discovered vectorized operations. These are central to good R programming, and are well described in the Introduction to R manual. Duncan Murdoch data <- data.frame(x= c(1,2,3,1,1,1), y = c(1,2,3,4,6,7))fin_hyp <- list(slope=2,constant=1)outputs <- data['y']

Re: [R] R setting number of knots in smoothing splines

2015-11-13 Thread Duncan Murdoch
quot; or "spar" parameter that controls the result much more than the knots. So I'd say you should read more about smoothing splines before you continue with your approach. Duncan Murdoch Thanks a lot. Regards! [[alternative HTML version deleted]] __

Re: [R] Why does a custom function called is.numeric.factor break lattice?

2015-11-16 Thread Duncan Murdoch
umeric.factor" could be a "numeric.factor" method for the "is" generic, or a "factor" method for the "is.numeric" generic. Using names with dots is a bad idea. This would be all be simpler and less ambiguous if the class had been named "num

Re: [R] SWEAVE - a gentle introduction

2015-11-17 Thread Duncan Murdoch
.name/knitr/ which I do not use myself (I use Sweave), but to be fair, is worth considering as an alternative. He did, and I'd agree with them. I've switched to knitr for all new projects and some old ones. knitr should be thought of as Sweave version 2. Duncan Murdoch Second,

Re: [R] Strange result when subsetting a data frame based on a character variable

2015-11-17 Thread Duncan Murdoch
larger number is likely not "10"; try it. (With the options I have on my computer, I get "1e+05".) If you want a numeric comparison, be explicit: subset(Data, as.numeric(Data$group) == ..) Duncan Murdoch Karl Schilling # Exemplary code for reproducing the abov

Re: [R] Strange result when subsetting a data frame based on a character variable

2015-11-17 Thread Duncan Murdoch
On 17/11/2015 2:25 PM, Duncan Murdoch wrote: On 17/11/2015 2:14 PM, Karl Schilling wrote: > Dear all, > > I have one observation that I do not quite understand. Maybe someone > can clarify this issue for me. > > I have a data frame which I want to subset based on a groupi

Re: [R] SWEAVE - a gentle introduction

2015-11-17 Thread Duncan Murdoch
on the rgl package lately (for movable 3D graphics); it is possible to embed those in a PDF document, but not portably (i.e. the PDF viewer will matter); it is much easier to embed rgl graphics in HTML. So I tend to use Markdown input through knitr (which calls Rmarkdown). Duncan Murdoch C

Re: [R] R hist density wrong?

2015-11-18 Thread Duncan Murdoch
ate a density. The formula for that is sum(h$density*diff(h$breaks)). Duncan Murdoch What am I misunderstanding here? Thanks a lot for the help! Cheers, Luca __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

Re: [R] How to split 32 bits data into 16 bit or 8 bit data

2015-11-22 Thread Duncan Murdoch
'll have to be careful about the sign. Or you could use the bitops package, bitShiftR(x, 16). In either case the results will display by default in decimal; if you want a hex display, use as.hexmode(). Duncan Murdoch __ R-help@r-project.org

Re: [R] RGL Problem

2015-11-23 Thread Duncan Murdoch
you can suppress its use. If you run this before the library call: options(rgl.useNULL = TRUE) then rgl won't try to open your X11 display, and the error shouldn't happen. (You won't be able to see output in X11 either.) Duncan Murdoch ___

Re: [R] RGL Problem

2015-11-23 Thread Duncan Murdoch
on CRAN is ancient. You'll need to reinstall it from source for a current one. Duncan Murdoch library(geomorph) Loading required package: rgl Warning messages: 1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display 2: In fun(libname, pkgname) : error in rgl_init I have al

Re: [R] RGL Problem

2015-11-23 Thread Duncan Murdoch
On 23/11/2015 7:45 AM, Stefan Evert wrote: On 23 Nov 2015, at 11:50, Duncan Murdoch wrote: The OSX binary version of rgl on CRAN is ancient. You'll need to reinstall it from source for a current one. Since you bring up this point: any chance of getting Mac binaries from CRAN

Re: [R] RGL Problem

2015-11-24 Thread Duncan Murdoch
Some comments on the second part of your message. On 23/11/2015 7:45 AM, Stefan Evert wrote: On 23 Nov 2015, at 11:50, Duncan Murdoch wrote: The OSX binary version of rgl on CRAN is ancient. You'll need to reinstall it from source for a current one. Since you bring up this point

Re: [R] RGL Problem

2015-11-26 Thread Duncan Murdoch
y on a web page, so it may be useful for some systems. (It can sort of display in RStudio; you need to load the rglwidget package, and call rglwidget() each time you want to see output. This behaviour is still in flux.) Duncan Murdoch __ R-help@r

Re: [R] Handling huge data of 17GB in R

2015-11-27 Thread Duncan Murdoch
00, 26000) However, it takes a lot of memory. Make sure you are trying this on a machine with 10 or 20 GB of free memory. (Each copy of your data takes about 5 GB; operations may result in duplication.) Duncan Murdoch dist<-read.big.matrix('dist.csv',sep=',',header=

Re: [R] system.file(...) self-referencing the containing package

2015-12-04 Thread Duncan Murdoch
t |.packageName| but don't trust this for the future.)" The more trustworthy approach is to use packageName() or getPackageName(). Duncan Murdoch Thanks much again, -Murat On Thu, Dec 3, 2015 at 6:42 PM, William Dunlap wrote: > Every package has in it, after it is insta

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread Duncan Murdoch
ks BUT will place NA in any columns with numbers as characters. The reuslt will be this for X19: num NA NA NA NA NA NA NA NA NA NA .. How can I target my goal with something else than lapply or writing a line for each type ? I don't see how a function could reliably detect the types, but it might

Re: [R] Windows R 2.15.1 on Citrix

2015-12-11 Thread Duncan Murdoch
using such an old version (released June, 2012). It's not even the last patch release of the 2.15.x series, which was 2.15.3. And even if you update to the most recent release (3.2.3), we probably can't help you with Citrix, though if you identify the problem w

Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Duncan Murdoch
used on arguments that precede ... in the function definition, exact matching on arguments that follow it. Duncan Murdoch If I change the position of ellipses fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){ dots <- list(...) cat("col.range =

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Duncan Murdoch
ersion number of the pbkrtest package that you're trying to install. (If R is downloading it for you, available.packages()["pbkrtest",] will give lots of useful information.) Duncan Murdoch __ R-help@r-project.org mailing list -- To UN

Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Duncan Murdoch
nd lots of existing code depends on it. Eventually you'll get to know the quirks of the design. Duncan Murdoch Best regards! Mario On 11 December 2015 at 15:55, David Winsemius wrote: > > > On Dec 11, 2015, at 9:40 AM, Mario José Marques-Azevedo < > mariojm...@gmai

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Duncan Murdoch
n its DESCRIPTION. You can see it failed tests on CRAN. Duncan Murdoch Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Dec 11, 2015 at 11:05 AM, Duncan Murdoch wrote: > On 11/12/2015 1:44 PM, Rich Shepard wrote: >> >> Trying to update package pbkrtest failed because of

Re: [R] stopifnot with logical(0)

2015-12-12 Thread Duncan Murdoch
On 12/12/2015 8:44 AM, peter dalgaard wrote: On 12 Dec 2015, at 10:54 , Martin Maechler wrote: My conclusion: Breaking such a fundamental lemma of logic as "the empty set is always true" Umm, that doesn't make sense to me. Surely you mean that "an AND-operation over an empty index set is

Re: [R] stopifnot with logical(0)

2015-12-12 Thread Duncan Murdoch
really subtle version of his cases {But the gut feeling is wrong, as I argue from now on}. Personally, I think the problem there is that people forget that == is vectorised, and for a non-vectorised equality check you really should use identical: stopifnot(identical(dim(x), c(3,4))) identi

Re: [R] plotmath not available on R 3.2.2

2015-12-12 Thread Duncan Murdoch
oper R installation, and it is only updated when R itself is updated. Perhaps install.packages() should give a different error message when you attempt to install a base package. Duncan Murdoch __ R-help@r-project.org mailing list -- To U

Re: [R] plotmath not available on R 3.2.2

2015-12-12 Thread Duncan Murdoch
as a warning, not an error). 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 comm

Re: [R] stopifnot with logical(0)

2015-12-14 Thread Duncan Murdoch
se identical() in such tests, and > you'd too and would quickly find and fix the "trap" of course.. > So you are mostly right also in my opinion... Ooops, yes - but you would discover this pretty quickly if you weren't coding in a email client ;) I wonder if R is missing a

Re: [R] stopifnot with logical(0)

2015-12-14 Thread Duncan Murdoch
nk it makes the intention clearer. I think there would be less confusion if stopifnot() required its args to be single logical values, so I usually try to use it that way. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] packaging an R-application

2015-12-23 Thread Duncan Murdoch
ctions in the R Installation and Administration manual for building a custom installer. 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 ht

Re: [R] Dput Help in R

2015-12-30 Thread Duncan Murdoch
sized amount of output. If the error doesn't happen, just take a bigger subset, and possibly leave off the beginning, e.g. y <- x[101:110,] for 10 lines starting at line 101. Duncan Murdoch __ R-help@r-project.org mailing list -- To UN

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

2015-12-30 Thread Duncan Murdoch
On 30/12/2015 2:32 PM, David Brand wrote: Error: could not find function "VectorSource" in package tm Windows 64bit using Rstudio please advise If you want advice about the error message, you need to tell us what you did to produce it. Dunc

Re: [R] text duplication bug in mtext?

2016-01-01 Thread Duncan Murdoch
different treatment of "adj" in text() and mtext(). The former uses one or two values to determine placement of all strings. The latter uses one value per string. Duncan Murdoch Here is a reproducible example. df1 <- data.frame(V1=rnorm(100)) hist(df1$V1) mtext("Test"

Re: [R] Additional polymath query

2016-01-02 Thread Duncan Murdoch
e characters. That one works on my OSX system running in RStudio, but you didn't say what particular output format you wanted, so you'll need to check it yourself. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] How to calculate the prediction interval without knowing the functional form

2016-01-03 Thread Duncan Murdoch
prediction interval depends on the uncertainty of individual observations, and that isn't usually reflected in predictions. For example, if y_i is N(mu, sigma^2), and we fit the model to N observations, all of our predictions will be ybar, and there will be no indication o

Re: [R] R package built using newer version of R

2016-01-04 Thread Duncan Murdoch
ites (e.g. compilers), you'll get it installed from source. If it fails, post the errors and the results of sessionInfo() here, and we'll probably be able to tell you what to do next. Duncan Murdoch __ R-help@r-project.org mailing list -

Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

2016-01-08 Thread Duncan Murdoch
CentOS about this. That code hasn't changed in rgl in a long time. It's possible that rgl is wrong, but I'd need more information from them to convince me. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

2016-01-11 Thread Duncan Murdoch
-nvidia.html . Thanks for following up on this. If I get any other similar reports, I'll be able to point them to your message. Duncan Murdoch Good luck! -Ben -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wittner, Ben, Ph.D. Sent: Friday, Ja

Re: [R] tikzDevice and Sweave

2016-01-17 Thread Duncan Murdoch
If you'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,

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

Re: [R] tikzDevice and Sweave

2016-01-18 Thread Duncan Murdoch
figure chunk 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.te

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
ough space. - 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. Dunc

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

2016-01-20 Thread Duncan Murdoch
n your first 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

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
yntax checking 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

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] Lists heading in an array of lists in R

2016-01-22 Thread Duncan Murdoch
t by assigning 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

Re: [R] R-help mailing list activity

2016-01-23 Thread Duncan Murdoch
end to answer far more 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 th

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").

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

2016-01-25 Thread Duncan Murdoch
likely to lead 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

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). D

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

2016-01-25 Thread Duncan Murdoch
would be much better if one or both of us posted a more helpful response when we saw a rude, unhelpful one. Duncan Murdoch On 25 January 2016 at 12:07, Duncan Murdoch wrote: > On 25/01/2016 2:45 PM, Oliver Keyes wrote: > >> I disagree, and would argue that fails to take a s

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

2016-01-26 Thread Duncan Murdoch
common is that discussion on threads goes off 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

Re: [R] Downloading Google finance data onto R

2016-01-26 Thread Duncan Murdoch
th Yahoo finance data, but got the same error. That symbol should be "LIQUIDBEES.BO" 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 getSym

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

2016-01-26 Thread Duncan Murdoch
or, I see "'"a"'" That's not legal R source, because the 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 "\"&#

Re: [R] R tool downloaded

2016-01-26 Thread Duncan Murdoch
ually 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 t

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

2016-01-27 Thread Duncan Murdoch
a copy 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/m

Re: [R] Error in loading caret

2016-01-29 Thread Duncan Murdoch
What version of caret did you 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

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

2016-01-29 Thread Duncan Murdoch
uch difficulties. I use R and ESS (GNU EMACS). (My ESS console says 'U' in 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

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(cusip,

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

2016-01-31 Thread Duncan Murdoch
iles/TIBCO/terrde40/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-

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") u

Re: [R] Big Finance and digits

2016-02-02 Thread Duncan Murdoch
Don't 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

Re: [R] Create macro_var in R

2016-02-03 Thread Duncan Murdoch
r code in a function, and 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

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 wrote: On 03

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

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

2016-02-05 Thread Duncan Murdoch
ifferent 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] Plot step function

2016-02-06 Thread Duncan Murdoch
more 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 yla

Re: [R] Setting directory in Windows

2016-02-07 Thread Duncan Murdoch
rt of your session. It lets you set 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 Win

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
tiple 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" ) retur

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 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 pressing reason to do this, I am

Re: [R] middle of interval

2016-02-08 Thread Duncan Murdoch
ot;", 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 t

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] 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/mailm

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

2016-02-14 Thread Duncan Murdoch
function. Remember to quote 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 g

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 h

Re: [R] cannot install stats package

2016-02-18 Thread Duncan Murdoch
e package? 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 pos

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

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

2016-02-22 Thread Duncan Murdoch
'll see "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 r

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

2016-02-22 Thread Duncan Murdoch
, you're on 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

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 wrote: Dear Rxperts.. I am able to generate tables using Tables R package.. However, when I have been unsuccessful in using kab

Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch
(with 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}{

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

2016-02-23 Thread Duncan Murdoch
reproducible example 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 U

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] readRDS problem

2016-02-24 Thread Duncan Murdoch
27;re not 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 pr

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] 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 peop

Re: [R] distribution freq

2016-02-25 Thread Duncan Murdoch
nt 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 d

Re: [R] Scaling x axis

2016-02-25 Thread Duncan Murdoch
hose years, 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 ma

Re: [R] getDLLRegisteredRoutines

2016-02-25 Thread Duncan Murdoch
e" are included 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/listinf

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

2016-02-26 Thread Duncan Murdoch
n="") 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, a

<    3   4   5   6   7   8   9   10   11   12   >