Re: [R] system() command not working

2016-06-05 Thread Berend Hasselman
> On 4 Jun 2016, at 22:12, Roy Mendelssohn - NOAA Federal > wrote: > > 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).

[R] Fw: i need to install "Rclimdex"........Senior Scientists , BARI

2016-06-05 Thread Ranjit Sen via R-help
Dear Sir: This is Dr Ranjit Sen, Senior Scientific Officer, Soil Science Division, Bangladesh Agricultural Research Institute(BARI). For my research on climatic variability and extreme events of climate of Bangladesh, I need to install the   Rclimdex software from R in my computer.  I

[R] detecting if a variable has changed

2016-06-05 Thread Neal H. Walfield
Hi, I have a huge list. Normally it is sorted, but I want to be able to add elements to it without having to use any special interfaces and then sort it on demand. My idea is to use something like weak references combined with attributes. Consider: # Initialization. l = as.list(1:10) #

[R] Reading and converting time data via read.table

2016-06-05 Thread Ek Esawi
Hi All-- I am relatively new to R. I am reading a csv file via read.table (MyFile). The data types in the file are date, string, integer, and time. I was able to read all the data and manipulated correctly except time, e.g., 12:30. I used as.Date to convert date and string and integer were

[R] Fw: i need to install "Rclimdex"........Senior Scientists , BARI

2016-06-05 Thread Ranjit Sen via R-help
- Forwarded Message - From: Ranjit Sen To: "c...@r-project.org" Sent: Sunday, June 5, 2016 2:24 PM Subject: i need to install "Rclimdex"Senior Scientists ,BARI Dear Sir:This is Dr Ranjit Sen, Senior Scientific Officer,

Re: [R] Fw: i need to install "Rclimdex"........Senior Scientists , BARI

2016-06-05 Thread Sarah Goslee
The RClimDex website has instructions for obtaining and installing this package, and for obtaining and installing R if you also need to do that: http://etccdi.pacificclimate.org/software.shtml You must follow those directions, as the necessary first step is obtaining a download password from the

Re: [R] system() command not working

2016-06-05 Thread J Payne
Thanks Berend, that’s super useful. In summary, here is what I found: The problem (if I understand correctly) is that R was not passing environment variables to OSX El Capitan successfully. In any case: These do not work: 1. Setting the environment variable in my .bash_profile (for example

Re: [R] system() command not working

2016-06-05 Thread J Payne
I forgot to add that setting the environment variable in .Renviron in my home directory *also* works. I have updated my question on Stackoverflow to include these answers. John On 6/5/16, 1:17 PM, "J Payne" wrote: >Thanks Berend, that’s super useful. In summary, here is

Re: [R] detecting if a variable has changed

2016-06-05 Thread Ted Harding
Ah, perhaps I'm beginning to undertstand the question! Presumably the issue is that evaluating X[X<=y] takes O(n) time, where n = length(X), and similarly X[X>y]. So I suppose that one needs to be looking at some procedure for a "bisecting" search for the largest r such that X[r] <= y, which

Re: [R] detecting if a variable has changed

2016-06-05 Thread Bert Gunter
This help thread suggested a question to me: Is there a function in some package that efficiently (I.e. O(log(n)) ) inserts a single new element into the correct location in an already-sorted vector? My assumption here is that doing it via sort() is inefficient, but maybe that is incorrect.

Re: [R] system() command not working

2016-06-05 Thread J Payne
Thanks very much Roy! I will post to R-Sig-Mac. I browsed their archives but didn’t see anything about the issue – I might have missed something, though. John On 6/4/16, 1:12 PM, "Roy Mendelssohn - NOAA Federal" wrote: >Hi John: > >When El Capitan first came

Re: [R] detecting if a variable has changed

2016-06-05 Thread William Dunlap via R-help
I don't know what you mean by "without having to use any special interfaces", but "reference classes" will do what I think you want. E.g., the following makes a class called 'SortedNumeric' that only sorts the vector when you want to get its value, not when you append values. It stores the

Re: [R] detecting if a variable has changed

2016-06-05 Thread Bert Gunter
Nope, Ted. I asked for a O(log(n)) solution, not an O(n) one. I will check out the data.table package, as suggested. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County"

Re: [R] detecting if a variable has changed

2016-06-05 Thread Neal H. Walfield
On Sun, 05 Jun 2016 19:34:38 +0200, Bert Gunter wrote: > This help thread suggested a question to me: > > Is there a function in some package that efficiently (I.e. O(log(n)) ) > inserts a single new element into the correct location in an > already-sorted vector? My assumption here is that doing

Re: [R] Training set in Self organizing Map

2016-06-05 Thread ch.elahe via R-help
Hi Jeff, Thanks for your reply. My df contains Protocols and their Parameters and I want to use SOM to see if I can find some clusters in customor's using protocols. Some of these Parameters are factors and some are numeric. I want to make a subset of some protocols and give them to SOM as

Re: [R] detecting if a variable has changed

2016-06-05 Thread Neal H. Walfield
Hi, This looks more or less what I'm looking for! Thanks! :) Neal On Sun, 05 Jun 2016 18:47:11 +0200, William Dunlap wrote: > > [1 ] > [2 ] > I don't know what you mean by "without having to use any special > interfaces", but "reference classes" will do what I think you want. > E.g., the

Re: [R] detecting if a variable has changed

2016-06-05 Thread Ted Harding
Surely it is straightforward, since the vector (say 'X') is already sorted? Example (raw code with explicit example): set.seed(54321) X <- sort(runif(10)) # X ## The initial sorted vector # [1] 0.04941009 0.17669234 0.20913493 0.21651016 0.27439354 # [6] 0.34161241 0.37165878 0.42900782

Re: [R] Reading and converting time data via read.table

2016-06-05 Thread Jim Lemon
Hi EKE, Your problem may be that the date strings are being read as a factor. Try using stringsAsFactors=FALSE when you read the data in. Another way is to convert your dates to strings when passing to as.Date: as.Date(as.character(mydf$Date),"%m/%d/%Y") Jim On Sun, Jun 5, 2016 at 10:53 PM, Ek

[R] dissolve tiny polygons to others with unionSpatialPolygons{maptools}

2016-06-05 Thread Kumar Mainali
I am trying to use unionSpatialPolygons() of maptools to eliminate sliver in species range. I want to dissolve tiny sliver polygons in a shapefile to bigger polygons as "Eliminate (Data Management)" of ArcMap does. Whereas I can dissolve polygons that have identical features in the argument "IDs",

Re: [R] How to specify a data frame column using command line arg?

2016-06-05 Thread Jim Lemon
Yes, I see what you want. I can't run this myself as my work computer runs Windows and insists on starting Statistica when I run an R file in batch mode. What about: plot(adl1[,args[1]],adl1[,args[2]]) I just noticed that you are plotting in ggplot, so this won't help. Maybe: aes(x=args[1],

Re: [R] How to specify a data frame column using command line arg?

2016-06-05 Thread Jim Lemon
Hi Doug, I think this will work for you: adl1<-read.csv("test.csv") adl1[,"a"] [1] 1 4 7 so, adl1[,args[1]] should get you the column that you pass as the first argument. Jim On Mon, Jun 6, 2016 at 5:45 AM, Douglas Johnson wrote: > I'm guessing this is trivial but I've

Re: [R] detecting if a variable has changed

2016-06-05 Thread Duncan Murdoch
On 05/06/2016 2:13 PM, Bert Gunter wrote: Nope, Ted. I asked for a O(log(n)) solution, not an O(n) one. I don't think that's possible with a numeric vector. Inserting an entry at a random location is an O(n) operation, since you need to move all following values out of the way. Duncan

[R] How to specify a data frame column using command line arg?

2016-06-05 Thread Douglas Johnson
I'm guessing this is trivial but I've spent two hours searching and reading FAQ, tutorial, introductory and 'idiom' documents and haven't found a solution. All I want to do is select a data frame column at run time using a command line arg. For example, the "test.csv" file contains: a,b,c 1,2,3

Re: [R] Reading and converting time data via read.table

2016-06-05 Thread Ek Esawi
Thanks Jim! The problem is not date data. The problem is time. I figured out that I can use chron library and then use this expression times(paste0(t2, ":00")) because my time data are not h:m:s, only h;m. The problem I am trying to figure out is how to implement [times(paste0(t2, ":00"))] on

Re: [R] find longest consecutive streak in double

2016-06-05 Thread Jim Lemon
Hi Nick, I think you want to get the maximum run length: jja<-runif(92,0,16) med_jja<-median(jja) med_jja [1] 7.428935 # get a logical vector of values greater than the median jja_plus_med<-jja > med_jja # now get the length of runs runs_jja_plus_med<-rle(jja_plus_med) # finally find the maximum

[R] find longest consecutive streak in double

2016-06-05 Thread Nick Tulli
Hey guys. Learning R after gaining a background in Python this year, and I'm translating my Python projects to R now. This is the first time I'm posting to the mailing list. Essentially, I have 92 data points in one double that I created from a netcdf file. Those 92 data points represent a

[R] Estimating gumbel copula parameter

2016-06-05 Thread Sachin Kuruvithadam
Hi all. I'm a R newbie, so please bear with me. I'm fitting nine log losses series (log returns multiplied by -1, so that I have losses on the right and returns on the left) using copulas. My project in more detail: 1) I've filtered the residuals using univariate ARMA-GARCH models, and