Re: [R] reading in hexadecimal data - not working with data ending in E

2014-10-08 Thread Duncan Murdoch
all the data in just fine except points like `055E` or `020E`. In these cases, the E is stripped so I get just 055 or 020. You need to read the ?read.table help. as.is and text don't do anything like what you want. The argument you need to use is colClasses. I think you want to set it t

Re: [R] Evaluation of global variables in function definitions

2014-10-08 Thread Duncan Murdoch
On 08/10/2014 5:53 AM, H. Dieter Wilhelm wrote: Duncan Murdoch writes: > On 07/10/2014 2:45 AM, H. Dieter Wilhelm wrote: >> Hello (), >> >> I'd like to do the following >> >> a <- 3 >> f1 <- function (x){ >> a*x^2 >> } >> &g

Re: [R] How can I overwrite a method in R?

2014-10-09 Thread Duncan Murdoch
C_BinCount. You could fix this by prefixing C_BinCount as graphics:::C_BinCount, but that's internal code that might change in future releases. Duncan Murdoch > > [[alternative HTML version deleted]] > > __ > R-help@r-pr

Re: [R] Event after a package is loaded

2014-10-09 Thread Duncan Murdoch
used for that? No, I don't think so. ?setHook defines user hooks, but they are set separately by package, not generally. You could change the loadNamespace function if you want, but it won't work for other users. Duncan Murdoch __ R-hel

Re: [R] Changing date format

2014-10-09 Thread Duncan Murdoch
result in out of sync with the Sun. R Core is powerful, but I doubt if we could reform the calendar in this way. And I'd be against it in any case: I like to swim on my summer vacations, but if August slipped into the winter, the lakes around here would be frozen. Duncan Murdoch __

Re: [R] Windows RT

2014-10-09 Thread Duncan Murdoch
ecial about downloading R, but I don't know if that OS can run it. I think you'll have to ask Microsoft. Duncan Murdoch > > Ivania Andrade > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mai

Re: [R] Count number of Fridays in a month

2014-10-10 Thread Duncan Murdoch
gt; > How can this be done in R? > > Any help will be appreciated Convert your string to a POSIXlt object using as.POSIXlt. Then you can extract year, month and weekday from the result, and go from there. (The only unobvious part is figuring out how many days are in each month, but there are

Re: [R] Count number of Fridays in a month

2014-10-10 Thread Duncan Murdoch
On 10/10/2014 8:10 AM, Abhinaba Roy wrote: Hi Duncan, I have converted the string to a POSIXIt object using > strptime('31-may-2014',format="%d-%b-%Y") But could not figure out the way forward. Could you please elaborate a bit? Try this: ?POSIXlt Duncan Murdoch

Re: [R] Computing Water Balance using a loop.

2014-10-23 Thread Duncan Murdoch
ue, "w<-0 & w<-100" is not a sensible thing to do. > #print (w); > for (i in 1:length(Wb30$Rainfall)){ > for (j in 1:length(Wb30$Evaporation)){ > } > } Those loops do nothing. > wb<-Wb30$Water_Balance[w] + Wb30$Rainfall[i+1]-Wb30$Evaporation[j+1] Those

Re: [R] Help Getting the Price of Gold

2014-10-23 Thread Duncan Murdoch
zoo")). Use as.numeric() to convert to plain numbers, e.g. as.numeric(XAUUSD$XAU.USD[1,1]) Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/pos

Re: [R] how to calculate a numeric's digits count?

2014-10-24 Thread Duncan Murdoch
his problem, or it can't > be solved in R, because 1.340 will always be transformed autolly to 1.34? > No, there's no way to do what you want unless you put quotes around the number. R parses 1.345 and 1.3450 as exactly the same thing, whereas "1.345

Re: [R] Extra documentation not appearing

2014-10-25 Thread Duncan Murdoch
n link, you'll see something like this: http://127.0.0.1:16447/library/traj/doc/index.html That link gives a blank page. If you manually take away the index.html part and give this: http://127.0.0.1:16447/library/traj/doc it works fine. I'll take a look into this. Duncan Murdoch

Re: [R] Extra documentation not appearing

2014-10-25 Thread Duncan Murdoch
ll recommend changing your document to a vignette. They get a display with a title, unlike unknown files in inst/doc. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] Looking for Feature Hashing

2014-10-26 Thread Duncan Murdoch
ils, > please see http://en.wikipedia.org/wiki/Feature_hashing The "digest" package implements several different hash functions. You could use the hash values as names in an environment to index arbitrary objects associated with the values. Duncan Murdoch

Re: [R] About the availability of a new package

2014-10-26 Thread Duncan Murdoch
e to search package help pages. (That one doesn't find anything relevant for "Quantile Autoregression".) Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] How to cite R-Project

2014-10-29 Thread Duncan Murdoch
creating R, please cite it when using it for data analysis. See also ‘citation("pkgname")’ for citing R packages. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] problem with function "polygon"

2014-11-07 Thread Duncan Murdoch
om your workspace, or even better, delete the whole saved workspace). Duncan Murdoch __ R-help@r-project.org mailing list 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, reproducible code.

Re: [R] Urgent Help - Editing XML through R

2014-11-08 Thread Duncan Murdoch
he email > list. > > *XM File * > > > > > xmlns="urn:tibco:spotfire.dxp.automation.tasks"> > Open Analysis from Library > /Z- Archive - TO BE > purged/ConditionEmailTest > > Shouldn't you be contacting

Re: [R] which LETTERS?

2014-11-10 Thread Duncan Murdoch
,"C")) c("A", "B", "C") can't be repeated a whole number of times to extend to length 26, so it is repeated 8 2/3 times, and you get a warning. [1] 1 2 3 Warning message: In LETTERS == c("A", "B", "C") : longer objec

Re: [R] sweave package for R version 3.02

2014-11-11 Thread Duncan Murdoch
> (as ‘lib’ is unspecified) > Warning in install.packages : > package ‘sweave’ is not available (for R version 3.0.2) > > I tryied to download it's zip file but not get it. > > Anyone help me on how I can do it. Thanks As far as I know, there is no "sweave" pac

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread Duncan Murdoch
gt; > > > I looked at contour plot but it needs a shorted values of parameters and a > matrix of likelihood values. Is there any way to get the plot? or how can I > change my likelihood values to a matrix for the function "contour"? The interp() function in the akima package sh

Re: [R] "R CMD Rd2txt" generate "_^H" for in all section titles

2014-11-13 Thread Duncan Murdoch
ot;underline_titles" option (see ?Rd2txt_options) to FALSE if you don't want it. Duncan Murdoch __ R-help@r-project.org mailing list 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, reproducible code.

Re: [R] "R CMD Rd2txt" generate "_^H" for in all section titles

2014-11-14 Thread Duncan Murdoch
On 13/11/2014, 8:16 PM, Rolf Turner wrote: > On 14/11/14 13:59, Duncan Murdoch wrote: >> On 13/11/2014, 2:51 PM, Zheng Da wrote: >>> Hello, >>> >>> I'm trying to generate plain text from the .Rd files. I run "R CMD >>> Rd2txt xx.Rd -o xx.tx

Re: [R] "R CMD Rd2txt" generate "_^H" for in all section titles

2014-11-14 Thread Duncan Murdoch
t;less" command in Unix-alikes generally supports it for display. Duncan Murdoch > --- > Jeff NewmillerThe . . Go Live... > DCN:

Re: [R] expected arguments for rgl.triangles

2014-11-14 Thread Duncan Murdoch
gether a simpler example, e.g. two triangles, and see if that works. Then build up from there. Duncan Murdoch Thanks, Allie The code, where rows 2,3,4 are one triangle, 5,6,7 the next, etc (apologies - don't know how to serialize a dataframe to make it easy to suck into one's en

Re: [R] file.copy

2014-11-14 Thread Duncan Murdoch
On 14/11/2014 8:21 AM, Jeff Newmiller wrote: Sorry.. typo... file.copy(file.path(fromFolder,list.of.files), toFolder) Or construct the list of files containing full paths. See ?list.files. Duncan Murdoch --- Jeff

Re: [R] Urgent Help - Editing XML through R

2014-11-14 Thread Duncan Murdoch
hould have paid a license fee. But you are asking us to help you for free. You should have a Spotfire license, and you should be asking Tibco for help to work with it. Duncan Murdoch Thanks in advance. Regards Chidambaram On Nov 8, 2014 1:10 PM, "Chidambaram Selvakumar"

Re: [R] Fine controlling "three dots" argument dispatch to functions with identical argument names

2014-11-15 Thread Duncan Murdoch
all(). But this is hard to read and easy to get wrong, so I recommend Jeff's simple solution. Duncan Murdoch > > --- > Jeff NewmillerThe .

Re: [R] Fine controlling "three dots" argument dispatch to functions with identical argument names

2014-11-16 Thread Duncan Murdoch
if it ties you to a particular implementation of foobar it might not be. For example, I'd rather read "cex.axis is the character size on the axis", rather than "args_axis is a named list of arguments to pass to the axis function". Duncan Murdoch > foobar <- fu

Re: [R] duplicated function

2014-11-18 Thread Duncan Murdoch
n function, e.g. nonunique <- function(x) duplicated(x) | duplicated(x, fromLast=TRUE) ? Something I've wanted more than once is a variation on duplicated that returns the index of the duplicated element, so for example dupindex(c(7,7,7,2,3,2)) would return 0 1 1 0 0 4 or possibly 1

Re: [R] duplicated function

2014-11-18 Thread Duncan Murdoch
On 18/11/2014 11:22 AM, John Laing wrote: That seems straightforward enough: > x <- c(7, 7, 7, 2, 3, 2) > match(x, x) [1] 1 1 1 4 5 4 > ifelse(duplicated(x), match(x, x), 0) [1] 0 1 1 0 0 4 Nice solution! Thanks. Duncan Murdoch On Tue, Nov 18, 2014 at 10:40 AM, Duncan Murdoch

Re: [R] install R without texlive dependencies

2014-11-20 Thread Duncan Murdoch
cated to it. R should be perfectly happy working with the TexLive you already have. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] R website

2014-11-20 Thread Duncan Murdoch
the book will eventually show up. (To do that, take a look at the Bibtex .bib file, available at http://www.r-project.org/doc/bib/R.bib, and put together additions in a consistent format. If it is not obvious why your book should be included, explain why.) Duncan Murdoch

Re: [R] R website

2014-11-20 Thread Duncan Murdoch
any hope of getting such a change to be adopted > before I spent more time on it. Feedback and comments welcome. You're sending that to the wrong place. The R website is www.r-project.org; cran.r-project.org is the CRAN website. You'll need to discuss that one with CRAN. Duncan Murd

Re: [R] C project within R function

2014-11-21 Thread Duncan Murdoch
teps to undergo or where can I check to perform that > successfully? > Sorry, but your constraint (no package building) is irrational. By *far* the easiest way to do this is to write a package. Duncan Murdoch > > > Thanks in advance, > > My best regards, >

Re: [R] Presentation tables in R (knitr)

2014-11-25 Thread Duncan Murdoch
certain rows of the table. See the last example in ?tabular. (It's possible to do logical indexing, but a little harder. I think the vignette has an example of this...) You can use latex() on the results, and display them in a knitr document. Duncan Murdoch tabular(Meas

Re: [R] package submission

2014-11-28 Thread Duncan Murdoch
ider writing to the submission email address, but I wouldn't do it sooner than that. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/po

Re: [R] please please unsubscribe!!!!!!!!!!!!!!!!

2014-11-30 Thread Duncan Murdoch
pretty bad tradeoff to me. Why don't you complain to Google about Gmail? Duncan Murdoch > > So I see three possibilities: leave as it is now, switch precedence to > "bulk" if it doesn't interfere on list behavior and have at least a > small unsubscribe button on so

Re: [R] cyclic dependency when building a package

2014-11-30 Thread Duncan Murdoch
ber of "Depends" entries. Each of those potentially causes a change to the user's search list, and may break something. It's much better to use "Imports" instead, because that makes the other packages available to you, but doesn't put them in the search list

Re: [R] R dplyr solution vs. Base R solution for the slect column total

2014-11-30 Thread Duncan Murdoch
the original form, and then think about how you want to present it, and write a function that displays the result, with nice formatting, etc. That probably won't happen in the R console, you should be using Sweave or knitr or some other package for presentation of the results. Dunca

Re: [R] rgl WebGL export

2014-12-01 Thread Duncan Murdoch
-forge. It has some bug fixes, but it will still be a few days or weeks before it makes it to CRAN. If you still don't get what you want, then please put together a simple example and send it to me, explaining what you want, and what you see, and I'll try to fix it i

Re: [R] please please unsubscribe!!!!!!!!!!!!!!!!

2014-12-01 Thread Duncan Murdoch
the top of the message. I don't care if you add an extra line at the bottom (even if you YELL), but I often browse in a fairly small window, and I'd like to see what's at the top. Duncan Murdoch Martin > And then continue on for each R message. Because top-posting

Re: [R] Sorting method used by order()

2014-12-02 Thread Duncan Murdoch
ix" is sometimes used: see the Details section in the help page. For order(), the method is undocumented and not under your control. Use sort.list() if you need the control. Read the source if you want to know the current implementation (but being undocumented, it might change without notice

Re: [R] How are packages installed with install_github() updated in RStudio?

2015-08-18 Thread Duncan Murdoch
#x27;ll install the CRAN version of foo even if you already have a newer one from github. Duncan Murdoch > > Hadley > > On Tue, Aug 18, 2015 at 8:14 AM, John Kane wrote: >> Hi Michal, >> >> Because RStudio seems to use its own method of updating you might be b

Re: [R] how to create contour lines on a 3D surface plot by persp3d from rgl package

2015-08-20 Thread Duncan Murdoch
2, len=50) y <- seq(-2, 2, len=50) z <- outer(x,y,f) persp3d(x,y,z, col="red",alpha=0.5) lines <- contourLines(x, y, z) for (i in seq_along(lines)) { x <- lines[[i]]$x y <- lines[[i]]$y z <- rep(lines[[i]]$level, length(x)) lines3d(x, y, z) } Duncan Murdoch --

Re: [R] [Rmarkdown] html_document - custom CSS for code snippets

2015-08-21 Thread Duncan Murdoch
ssible? Sure, just enter it as ``` x = 1; for (var i=0; i<2; i++) ``` You won't get syntax highlighting; if you want that, you'll need to create a "Javascript engine"; see ?knitr::knit_engines, or use a different one (the "coffee" engine is probably fine): ```{coffee

Re: [R] Separate point sizes in rgl.points()?

2015-08-29 Thread Duncan Murdoch
you only get one size per call to points3d. Duncan Murdoch > > function (vectors, Div = 40, Layers = 3, DrawAxes = FALSE) > { > open3d(windowRect = c(100, 100, 800, 800)) > bg3d("white") > Cx = vectors[, 1] > Cy = vectors[, 2] > Cz = v

Re: [R] automatically calling dev.off()

2015-09-01 Thread Duncan Murdoch
make sense to call dev.off() after the plot() command, because the user might be planning to add something to it. You need to tell R that you are done, and that's what dev.off() is for. You can call it automatically in a function by using on.exit(dev.off()) and it should happen automatically

Re: [R] automatically calling dev.off()

2015-09-01 Thread Duncan Murdoch
raphics should work, and it's not compatible with standard R graphics. However, it would be pretty easy to get this to work with a grid graphics based systems (e.g. ggplot2, lattice) since they don't draw anything until you print the object: you'd just need to override the print met

Re: [R] How to use dwish in MCMCpack in R

2015-09-03 Thread Duncan Murdoch
; How do I determine W, the positive definite matrix. The matrix provided in > the documentation doesnot help. Your question doesn't make sense. You want to compute the density of a Wishart distribution. That's a distribution of matrices. So you just put in the matrix at which

Re: [R] How to use dwish in MCMCpack in R

2015-09-03 Thread Duncan Murdoch
On 03/09/2015 12:41 PM, Anamika Chaudhuri wrote: > I put in the matrix at which I want the density as S. I was wondering > what is W then? You need to read the help page. The matrix at which you want the density is W. S is a parameter of the distribution. Duncan Murdoch > > Than

Re: [R] Manova: Data similarly generated are significantly different.

2015-09-04 Thread Duncan Murdoch
s vs g you see a huge effect. You aren't testing whether the y's are equal, you are testing whether the triplets depend on g, and they do. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.et

Re: [R] Seeking help

2015-09-09 Thread Duncan Murdoch
On 09/09/2015 8:11 AM, varun yadav wrote: Hi, I am working on Predictive analytics assignment This list isn't for help with homework. You should ask your instructor for help. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBS

Re: [R] How to do global curve fitting in R

2015-09-09 Thread Duncan Murdoch
e's also an example of a "self-starting" logistic regression model in ?selfStart. Duncan Murdoch > > Thanks! > > Jianling > > > On 9 September 2015 at 10:16, Bert Gunter wrote: >> Jianling: >> >> 1. What models are you trying to fit? Details

Re: [R] intersection between two matrices based on two columns in R

2015-09-09 Thread Duncan Murdoch
On 09/09/2015 3:48 PM, Jeff Newmiller wrote: > Matrices and data frames are write different. For this you most likely want > to use days frames. ... > Sent from my phone. Please excuse my brevity. ... and your auto-correct. ;-) Duncan Murdoch ___

Re: [R] Counting occurrences of a set of values

2015-09-10 Thread Duncan Murdoch
r most purposes, they aren't. If you really want to keep the ordering, then table() does the counting you want, it just returns it in an ugly format. Duncan Murdoch > > So for a dataset: > > V1, V2, V3 > 1, 2, 1 > 1, 3, 2 > 1, 2, 1 > 1, 1, 1 > > The output would

Re: [R] Is there any concise way to write a one-to-one mapping?

2015-09-14 Thread Duncan Murdoch
ot;c", trend = "ct")[type] type2 <- switch(type, none = "nc", drift = "c", trend = "ct") Duncan Murdoch I am wondering if there's a concise way to write a mapping from type to type2, especially when the number of categories is high. T

Re: [R] getting means by group within time point for data on multiple lines (long rather than wide file)

2015-09-17 Thread Duncan Murdoch
ove subjects with other than 3 observed times. (It doesn't take NA into account; if you need to do that, you'll need to make that function(sub) more complicated. "sub" will be a dataframe containing data for just one subject.) The "do.call(rbind" puts the list output fr

Re: [R] Hep with regex! - combination of ^, |, \\, _ and $

2015-09-17 Thread Duncan Murdoch
x[grep("^q10.+1", x)] > > # Which strings start with "q10" AND end with a "_1"? - DOES NOT WORK > x[grep("^q10.+\\_1$", x)] Your verbal description doesn't match your regexp, and you didn't show us your output, so how can we tell wheth

Re: [R] Hep with regex! - combination of ^, |, \\, _ and $

2015-09-17 Thread Duncan Murdoch
nterpreted "works" and "does not work" to be saying that R's regexp matching was working or not. I think you've got your answers from others now... Duncan Murdoch > Thank you! > > On Thu, Sep 17, 2015 at 5:42 PM, Duncan Murdoch > wrote: >>

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread Duncan Murdoch
ght on this one, in that it is a user-interface issue. People can implement front-ends to R that do just about anything, but those aren't part of R. Duncan Murdoch > The calculation engine of Excel admittedly has some weak points. > > That is the reason why I wrote RExcel whi

Re: [R] Download showing as exploit

2015-09-21 Thread Duncan Murdoch
d do is ask your IT service for details of what the problem is, and ask them to confirm it's real. If so, please let us know the details. If not, then I can't see how we can help. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSU

Re: [R] 'R' Software Output Plagiarism

2015-09-22 Thread Duncan Murdoch
ve been promoted so far beyond their competence that they'll buy anything if it is expensive enough. This isn't uncommon. Duncan Murdoch > > Similarly to John Kane, I think it is necessary to know exactly what sources > the text is claimed to be plagiarized from and/or what pa

Re: [R] retaining characters in a csv file

2015-09-22 Thread Duncan Murdoch
t; -- I still want the first, third, etc columns to become numeric. There can > be more than > one variable like this, and not always in the second position. No, because the bloody quotes are part of the "csv standard". They aren't meaningful. If you don't know what th

Re: [R] retaining characters in a csv file

2015-09-22 Thread Duncan Murdoch
> strings are necessarily text. It specifically does not. Quotes allow commas and spaces to be ignored as column separators. That's all. They say nothing about the type of data. Duncan Murdoch > > I think we have been here before, and found that even if we decide that it is >

Re: [R] retaining characters in a csv file

2015-09-22 Thread Duncan Murdoch
t so easy to >> replace it with something else. > > IMHO this is a bug in read.csv(). No, it's a bug in "Rolf Turner", who believes in fairies at the end of his garden, rather than in documentation for file formats. Duncan Murdoch > > A possible workaround: >

Re: [R] Error: pandoc version 1.12.3 or higher is required and was not found

2015-09-23 Thread Duncan Murdoch
efined in knitr, which I have installed and it has pandoc() function > defined. The error is talking about the non-R software package called pandoc, which the pandoc() function makes use of. Pandoc the package does the heavy lifting, converting the Markdown into HTML, for example. Duncan Murdoc

Re: [R] lines - defining the range that is plotted

2015-09-24 Thread Duncan Murdoch
could use clip(min(x), max(x), min(y2), 0.3) before the call to lines() to get what you want. See the example in the help page for how to restore the full region. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Truncation of character fields in a data frame

2015-09-27 Thread Duncan Murdoch
eal case I got an > error of a missing line.] See the "comment.char" argument to read.table. By default the "#" character marks a comment, as in R code. Duncan Murdoch > > I can recreate this file as follows: > sample <- c(rep("p.001", 48)

Re: [R] R applications deployment models?

2015-09-28 Thread Duncan Murdoch
miliar with the others. 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] Counting number of rain

2015-10-02 Thread Duncan Murdoch
our code so that there's no chance > of fumble-fingering) I get: > >> Error in as.Date.numeric(1:7) : 'origin' must be supplied > > Why do these things always happen to *me*??? The zoo package replaces as.Date.numeric() with a function that assumes an origin of &q

Re: [R] Rayleigh Distribution

2015-10-02 Thread Duncan Murdoch
ys it is in the VGAM, lmomco, reliaR, etc. packages. Pick one of those, e.g. VGAM, which calls the quantile function "qrayleigh". Then if you have a sample x and want to compare to Rayleigh with scale 1, you do library(VGAM) qqplot(qrayleigh(ppoints(length(x))), x

Re: [R] scatter3d

2015-10-03 Thread Duncan Murdoch
ing the rgl.lines and rgl.quads calls that scatter3d uses; you're better off with lines3d and quads3d. If you don't include any points, you'll need to specify the range of the axes explicitly --- use the xlim, ylim and zlim arguments to decorate3d to do that. Duncan Murdoch >

Re: [R] Barplot - Beginners Question

2015-10-04 Thread Duncan Murdoch
nce: I > do not ret the rownames in my table as labels for the bars > > So what am I missing? Your data is a dataframe, VADeaths is a matrix. For some dim historical reason, pulling a column from a matrix keeps the row names, but pulling a column from a dataframe doesn't. You'l

Re: [R] R implementation on windows server

2015-10-06 Thread Duncan Murdoch
runs a service hosting Shiny applications; it's free for small demos, but you would pay for heavier use. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] Problem with binomial gam{mgcv}

2015-10-10 Thread Duncan Murdoch
value. If you wanted the null hypothesis to be true, you'd need to choose a success probability p somehow, then set y1 <- rbinom(500, size=100, prob = p). The random uniform has a far larger variance, and that leads to a larger deviance in gam, hence significance

Re: [R] error with seq() used in for loop

2015-10-11 Thread Duncan Murdoch
in the first place. The range of your loop is 1:m-1, where m is 4. That is > m <- 4 > 1:m-1 [1] 0 1 2 3 and x[0] is length 0. I think you wanted 1:(m-1) (or even better, seq_len(m-1)) for your loop values. Duncan Murdoch > > Thanks for helping. > > Maram > >

Re: [R] Windows release R 3.2.2 : internet.dll module

2015-10-13 Thread Duncan Murdoch
the location you downloaded from has a damaged copy. Duncan Murdoch >> https://cran.r-project.org/bin/windows/base/rw-FAQ.html >> >> 2.19 The Internet download functions fail. >> > > Best regards > > Philippe Dessen > IGR, Villejuif, France >

Re: [R] varying color in scatter3D plot

2015-10-16 Thread Duncan Murdoch
;)),xlab="Model",ylab="station",zlab="Error" ) > > You could see that the color of plotted points are varying with respect to > values on third column. I want them to vary W.r.t the 2nd column, while > keeping fer[,1] on x-axis, fer[,2] on y-axis and fer

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
hods’ in the ‘Writing R > Extensions’ manual. > Which plot argument is illegitimate or missing and how to eliminate the > warning? The first argument to plot.func needs to be called "x" if you want to use it as a method. Method signatures need to be consistent with the generic sig

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
= "title", # can't skip the arg name col, arg5, ...) { # can't skip the dots Duncan Murdoch > > Regards, > > On Monday, October 19, 2015 7:45 PM, Duncan Murdoch > wrote: > > > On 19/10/2015 1:29

Re: [R] Most appropriate function for the following optimisation issue?

2015-10-20 Thread Duncan Murdoch
On 20/10/2015 6:58 AM, Andy Yuan wrote: > Hello > > Please could you help me to select the most appropriate/fastest function to > use for the following constraint optimisation issue? Just project S into the space orthogonal to B, i.e. compute the residuals when you regress S on B (with no inter

Re: [R] expression evaluation during recursion

2015-10-22 Thread Duncan Murdoch
urses. In the first case, "parent.frame()" is only a default value, so recursion happens properly. If you change the first line in the body to these two lines if (missing(env)) env <- parent.frame() it would be equivalent. Duncan Murdoch

Re: [R] Error in Opening Project on R Studio

2015-10-22 Thread Duncan Murdoch
? if 'Yes' then how can I do > fix it ? Please help. You've written to the wrong place. You need to write to one of the RStudio support forums at support.rstudio.com. Duncan Murdoch __ R-help@r-project.org mailing list -- T

Re: [R] expression evaluation during recursion

2015-10-22 Thread Duncan Murdoch
() in the arguments list, or in the function body. You seem to have ignored my explanation. Duncan Murdoch Am 22.10.2015 um 19:05 schrieb Duncan Murdoch mailto:murdoch.dun...@gmail.com>>: On 22/10/2015 10:20 AM,david.kaeth...@gmail.com <mailto:david.kaeth...@gmail.com>wrote: Hello,

Re: [R] Environment question

2015-10-23 Thread Duncan Murdoch
ere the environment really matters, and this substitution would cause the function to return nonsense. Or if the user's f1 makes use of other global variables that happen to have the same name as other locals in f3, nonsense again. Duncan Murdoch > > An obvious but cumbersome way would

Re: [R] JSONlite import problem

2015-10-23 Thread Duncan Murdoch
obably multiple JSON objects without proper separators; you need to do the separating yourself. BTW, your attachment failed; only some file types are allowed. You should probably put the file online somewhere and post the URL. Duncan Murdoch __

Re: [R] JSONlite import problem

2015-10-24 Thread Duncan Murdoch
a text editor to create "proper" EOF > doesn't help. The problem is that you have valid-looking JSON objects on each odd numbered line, separated by single blank lines. The parser expects an EOF at the end of the first object, but instead it found a blank line and ano

Re: [R] [FORGED] Re: How to correct documentation?

2015-10-24 Thread Duncan Murdoch
"pounds divided by one thousand". The problem is that English is ambiguous. In many, many ways. We should rewrite all the help files in Loglan. Duncan Murdoch > If in the unlikely event that the documentation for some data set said > "Weight (gm/1000)", I'm

Re: [R] Creating new variables in R

2015-10-26 Thread Duncan Murdoch
data$variable3 <- ifelse(data$variable1 > data$variable2), data$variable1, > data$variable2) > > Both didn't work. > > I am not sure if my post is at all understandable (this is my first time > posting on R-help), but I am really hoping for some advice! This is

Re: [R] Function help

2015-10-26 Thread Duncan Murdoch
k for your class, you should ask your instructor for help. > > compute.hr <- function(pid){d <- subset(Batting.60, playerID==pid) > sum(d$HR)} That works for me. Duncan Murdoch > > Every time I try this, it says there's an unexpected symbol. Any id

Re: [R] [FORGED] Re: How to correct documentation?

2015-10-26 Thread Duncan Murdoch
trying to represent "divided by". The only valid argument I've heard so far is that we should use what the cited paper used. That was "1000 lbs", so I'll change it. Duncan Murdoch > > Accordingly, "lb/1000" is to be read "pounds per 1000" w

Re: [R] Creating new variables in R

2015-10-26 Thread Duncan Murdoch
aspect... Her syntax was incorrect in the original posting, that's all. Duncan Murdoch -pd On 26 Oct 2015, at 13:02 , Erich Neuwirth wrote: > data <- within(data,variable3=pmax(variable1,variable2)) > also should work if your variables are numeric. > > using dplyr and ma

Re: [R] [FORGED] Re: How to correct documentation?

2015-10-26 Thread Duncan Murdoch
be your first place to go. If you post here and get an argument about whether your suggestion is correct (as in this case), then you shouldn't post it as a bug report. This is the place for arguments, the bug list is *not*. Duncan Murdoch Thanks. --Ming On Sun, Oct 25, 201

Re: [R] Number of digits to display?

2015-10-26 Thread Duncan Murdoch
ns, is there a way to display > them as fractions of integers rather than > decimal expressions? See the fractions() function in the MASS package. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat

Re: [R] rgl plot rotation with device other than mouse

2015-10-27 Thread Duncan Murdoch
rgl itself has no support for getting input from anything other than the mouse and keyboard. 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 guid

Re: [R] rgl plot rotation with device other than mouse

2015-10-27 Thread Duncan Murdoch
; > In general, would it be possible to manipulate the plot, say for > example, with a standard joystick? Is there something "deeper" in the > code that I could look towards to make this possible? Or any other > library that might support something like this? I've alread

Re: [R] warning on generic function when building R package

2015-10-27 Thread Duncan Murdoch
ce > 435 797 1363 - fax > david.stev...@usu.edu > > > On 10/19/2015 2:32 PM, carol white via R-help wrote: >> In effect, this works >> but whether I use x or x.init, y or y.init in plot.func, I get >> >> no visible binding for global variable ‘x.init’no visible

Re: [R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread Duncan Murdoch
On 29/10/2015 6:38 PM, Marco Inacio wrote: > Is there a function in R to get the set of all unit vectors which are > orthogonal to a given vector? No. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] If else

2015-10-31 Thread Duncan Murdoch
;sex"es: Male, Female, and Indeterminate, > for each of which there is a potential assoctiation with type of crime. > With most analyses, however, a category of "NA" would be ignored > (at least by R). That claim is nonsense. R never ignores *anything* unless the analyst tell

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