Re: [R] which function

2016-06-04 Thread Jim Lemon
Hi Gafar, As Jeff has pointed out, the median value may not exist within the dataset. However, this function will give you either the position of the value that is the median, or the position of the two closest values if none equal the median. Be aware that this function may fall victim to the "ind

Re: [R] Johannes Hengelbrock

2016-06-04 Thread RICHARD M. HEIBERGER
fortune candidate Your example requires all choices of 1541 out of 3000, which I would expect to take somewhere near age-of-the-universe seconds to compute. The code uses a clever nested compuation due to Gail et al which will cut that time down to infinity/10. Sent from my iPhone > On Jun

Re: [R] String match

2016-06-04 Thread Bert Gunter
Please (re)-read the Help file for pmatch, which says: ... " (A partial match occurs if the whole of the element of x matches the beginning of the element of table.) " This is clearly not your situation. One approach (there may be others depending on what your detailed situation actually is) is t

Re: [R] system() command not working

2016-06-04 Thread Roy Mendelssohn - NOAA Federal
Hi John: When El Capitan first came out there was a discussion in the R-SIg-Mac list about environmental variables not being passed down to applications (not just R abut in general). I believe a work around was suggested, but I would search the archives for that. So what is happening, when

Re: [R] what is the code for trend free prewhitening trend analysis

2016-06-04 Thread Bert Gunter
Please refer to the posting guide (below) to learn how to post questions to this list. In particular, we do not generally write your code for you. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley

[R] system() command not working

2016-06-04 Thread J Payne
I’ve posted this question on StackExchange at http://stackoverflow.com/questions/37604466/r-system-not-working-with-modis-reprojection-tool, but haven’t received any replies.  I’m hoping that someone who understands the operation of the R system() command can help.  I have a command that wo

Re: [R] Application of "merge" and "within"

2016-06-04 Thread Santosh
Thanks so much.. I will try that.. and keep you posted.. on a different note.. using the above examples.. after adding a new column is blank.. summarizing a null column causes errors.. (like min(NULL) or min(NA) etc.. to avoid that I was trying the following code.. within(q, as.data.frame(as.matr

Re: [R] String match

2016-06-04 Thread jim holtman
try this: > WhereToLook = c("ultracemco.bo.openam" , "ultracemco.bo.higham" + ,"ultracemco.bo.lowam" , "ultracemco.bo.closeam" , + "ultracemco.bo.volumeam" ,"ultracemco.bo.adjustedam") > > WhatToLook = c("volume", "close") > > # create pattern match > pat <- paste(WhatToLook, collaps

Re: [R] which function

2016-06-04 Thread Jeff Newmiller
The median is not always a member of the data set. What do you really want? I for one would want people to follow the guidance in the footer on every email on this mailing list. -- Sent from my phone. Please excuse my brevity. On June 4, 2016 9:01:41 AM PDT, Gafar Matanmi Oyeyemi wrote: >De

[R] which function

2016-06-04 Thread Gafar Matanmi Oyeyemi
Dear, I need help on which.min and which.max. functions. Is there a function to fetch me the point that in vector that gives median value such like the commands for minimum and maximum values. Thanks. [[alternative HTML version deleted]] __ R-h

[R] what is the code for trend free prewhitening trend analysis

2016-06-04 Thread shonam sharma
Dear all, I am new to R studio. I have installed zyp package in R I want to run trend free prewhitening trend analysis Kindly tell me the code for the same -- with regards Shonam sharma JRF at Indian school of mines Dhanbad-826004 Email : sharma23sho...@gmail.com

[R] String match

2016-06-04 Thread Christofer Bogaso
Hi again, I am facing trouble to match a vector strings. Let say I have below full string vector WhereToLook = c("ultracemco.bo.openam" , "ultracemco.bo.higham" ,"ultracemco.bo.lowam" , "ultracemco.bo.closeam" , "ultracemco.bo.volumeam" ,"ultracemco.bo.adjustedam") WhatToLook = c("vol

Re: [R] merging dataframes in a list

2016-06-04 Thread jim holtman
Here is how you can to it with tidyr: > x <- list(data.frame(name="sample1", red=20) + , data.frame(name="sample1", green=15) + , data.frame(name="sample2", red=10) + , data.frame(name="sample2", green=30) + ) > library(dplyr) > library(tidyr) > > # convert to 'name, type, value';

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
Dear Sir, When I start R and type in library("Rcmdr") I do not face this problem. Only when I click on Rcmdr from Ubuntu interface I get the above mentioned error. I tried to find the .RData file but I could not find it in the path returned by getwd(). For the time being I am content with typing

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Fox, John
Dear Ashim, The grid() function is in the base R graphics package and should be attached to the search path (along with stats and some other standard packages). Close your R session and try again. If the problem persists, make sure that you don't have a saved workspace that's being loaded ev

Re: [R] Request for help

2016-06-04 Thread Michael Dewey
Dear Suparna You do not say whether the problem is (a) creating a help page to start with (b) understanding how to edit it afterwards. If the former then Duncan's advice to use prompt (or package.skeleton if you have not got anything set up yet) is good advice. If (b) then try it and post agai

[R] Johannes Hengelbrock

2016-06-04 Thread Therneau, Terry M., Ph.D.
I'm traveling so chasing this down more fully will wait until I get home. Four points. 1. This is an edge case. You will notice that if you add "subset=1:100" to the coxph call that the function works perfectly. You have to get up to 1000 or so before it fails. 2. The exact partial likeli

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
Dear Peter, Many thanks. Now when i do :- library(stats) data(Anscombe, package="car") densityPlot( ~ income, data=Anscombe, bw="SJ", adjust=1, kernel="gaussian") I get the output of rug on the x axis but not kernel density graph. Also I get :- [1] NOTE: R Commander Version 2.2-0: Sat Jun 4 14

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread peter dalgaard
> On 04 Jun 2016, at 09:09 , Ashim Kapoor wrote: > [...] > [4] ERROR: > could not find function "model.frame" > > > My session details are :- > >> sessionInfo() > [...] > attached base packages: > [1] splines utils grDevices base Looks like you somehow managed to detach (or not attach

[R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
Dear all, I am new to using Rcmdr. From the menu I chose the following : - data(Anscombe, package="car") densityPlot( ~ income, data=Anscombe, bw="SJ", adjust=1, kernel="gaussian") This gave me the following error:- [1] NOTE: R Commander Version 2.2-0: Sat Jun 4 12:32:09 2016 [2] NOTE: Rcmdr