Re: [R] using match-type function to return correctly ordered data from a dataframe

2012-10-27 Thread Markus Weisner
##.#. Live > Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > -

[R] using match-type function to return correctly ordered data from a dataframe

2012-10-26 Thread Markus Weisner
I am regularly running into a problem where I can't seem to figure out how maintain correct data order when selecting data out of a dataframe. The below code shows an example of trying to pull data from a dataframe using ordered zip codes. My problem is returning the pulled data in the correct or

Re: [R] need advice on using excel to check data for import into R

2012-04-22 Thread Markus Weisner
ils on the web site. > > Rich > > On Sun, Apr 22, 2012 at 2:34 PM, Markus Weisner wrote: > >> I have created an S4 object type for conducting fire department data >> analysis. The object includes validity check that ensures certain fields >> are present and that dup

[R] need advice on using excel to check data for import into R

2012-04-22 Thread Markus Weisner
I have created an S4 object type for conducting fire department data analysis. The object includes validity check that ensures certain fields are present and that duplicate records don't exist for certain combinations of columns (e.g. no duplicate incident number / incident data / unit ID ensures

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Markus Weisner
addresses) > > [1] "S Main St & Interstate 95" "3421 BIGS St" > > > > Bill Dunlap > > Spotfire, TIBCO Software > > wdunlap tibco.com > > > > > >> -Original Message- > >> From: r-help-boun...@r-project.org [mai

[R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Markus Weisner
trying to switch out addresses that have double directions, such as the following example: a = "S S Main St & Interstate 95" a = gsub(pattern="S S ", replacement="S ", a) … the problem is that I don't want to affect instances where this might be a correct address such as the following: "3421

[R] stumped on how to reorder factors

2011-08-30 Thread Markus Weisner
and up to 20 different numbers for each unit type. Having an automated way of ordering these units would be a huge help. Thanks in advance for any help you can provide. --Markus Weisner [[alternative HTML version deleted]] __ R-help@r-proje

Re: [R] dataframe selection using a multi-value key

2010-09-07 Thread Markus Weisner
t(merged_data, is.na(UNIT_TYPE), select=c(INC_NO, INC_YEAR, > INC_TYPE)) >INC_NO INC_YEAR INC_TYPE > 10 8 2008 FIRE > > > > > On Tue, Sep 7, 2010 at 8:25 PM, Markus Weisner wrote: > > I am merging two dataframes using a relational key (incident number and >

[R] dataframe selection using a multi-value key

2010-09-07 Thread Markus Weisner
I am merging two dataframes using a relational key (incident number and incident year), but not all the records match up. I want to be able to review only the records that cannot be merged for each individual dataframe (essentially trying to select records from one dataframe using a multi-value re

[R] to extend data.frame or not ... that is the question

2010-07-19 Thread Markus Weisner
}) ### create example object DF = data.frame(incident_num=c(1,2,2,3,4,4), incident_type=c("EMS", "FIRE", "FIRE", "EMS", "FIRE", "FIRE"), unit=c("E1", "E5", "T1", "E3", "E1", "T1"), response_time=c(300,400,35

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-09 Thread Markus Weisner
a.frame class to include some data verifications? If so, do you have some basic pointers for setting something like that up? Really appreciate all your help thus far. Hopefully, one last advice email will do the trick. Thanks. --Markus On Mon, Feb 8, 2010 at 6:43 PM, Martin Morgan

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Markus Weisner
}) data[5,c("a")] The problem is that I cannot access S4 object slots using @ and a character variable. I also cannot access a slot using the typical brackets since that is what I am trying to define here. Kind of stuck. Thanks for any advice you might have. Best, Markus On Mon,

Re: [R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Markus Weisner
"a")] = 200 #would also like this to work -- any ideas? Do you have any suggestions for getting assignments and brackets to work as they would for data frames? Thanks so much for your help. Best, Markus On Mon, Feb 8, 2010 at 2:44 PM, Martin Morgan wrote: > On 02/07/2010 08:31 PM, M

[R] using setMethod or setGeneric to change S4 accessor symbol from @ to $

2010-02-08 Thread Markus Weisner
I created some S4 objects that are essentially data frame objects. The S4 object definitions were necessary to verify data integrity and force a standardized data format. I am, however, finding myself redefining all the typical generic functions so that I can still manipulate my S4 objects as if

[R] documenting methods for S4 objects

2010-01-06 Thread Markus Weisner
I put out an email last night with output from my package check. Many thanks to Uwe and Liviu who got back to me quickly about how to fix some of the errors. I realize though, that I had some additional questions / confusion points in terms of documenting packages. 1) I seem to understand how t

[R] debugging package

2010-01-05 Thread Markus Weisner
I am trying to debug a package to submit it to CRAN and am getting a bunch of error messages. Most of the errors are because of the Rd files which were automatically populated by the package.skeleton function. I find the section on documentation to be pretty confusion in the R Extensions manual.

[R] package license questions

2010-01-03 Thread Markus Weisner
I am looking for some advice on licenses. Here is my situation: Over the last couple years, I have developed a rather large number of fire department analysis functions. I am in the process of trying to publish some packages to make these functions available to the public. I am trying to releas

[R] how to create a new data type

2009-10-22 Thread Markus Weisner
I am working on a new package to do fire department analysis. I am working with emergency dispatch data from different agencies that all contain the same information but have slightly different formats. Typically the variable names and date-time formats are different. I am getting pretty good at

[R] projecting GIS coordinates for analysis with spatstat package

2009-03-01 Thread Markus Weisner
r Vehicle Accident", "Alarm Activation", "Emergency Medical Service", "Alarm Activation", "Fire", "Emergency Medical Service", "Emergency Medical Service")) #add necessary libraries library(sp) library(maptools) library