[R] Bivariate kernel density bandwidth selection

2010-12-09 Thread Glen Sargeant
records, so you can see my problem. I should think that others must surely have encountered and overcome this challenge. If anyone can kindly point me in a productive direction, I will be most grateful. - Glen Sargeant Research Wildlife Biologist -- View this message in context: htt

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-22 Thread Glen Sargeant
("plot.pdf") lapply(names,function(nms){ plot(df.lst[[nms]][,2], df.lst[[nms]][,3],col=clr[[nms]]) mtext(nms)}) dev.off() - Glen Sargeant Research Wildlife Biologist -- View this message in context: http://n4.nabble.com/Mutliple-sets-of-data-in-one-dataset-Need-a-loop-tp1018

Re: [R] Mutliple sets of data in one dataset....Need a loop?

2010-01-20 Thread Glen Sargeant
mes #Now you can use lapply() to carry out the same operation on #each component of your list. For example, to send plots to #a pdf with 1 page for each component: pdf("plot.pdf") lapply(df.lst,function(df)plot(df[,2],df[,3])) dev.off() - Glen Sargeant Research Wildlife Biol

Re: [R] Dividing a pixel image into factors - (cut.im(), cut.default())

2009-12-04 Thread Glen Sargeant
60, or thereabouts). > > However, I would like to specify the pixel value at which the factors > are created - e.g. create one factor containing pixel values of 0-5 and > another factor containing all other pixel values. I have been > struggling to work out how to do this using eith

Re: [R] Time Zone names on Windows

2009-10-20 Thread Glen Sargeant
Keith, If you are working within a single time zone, including time zone information with each record does not seem necessary and you probably are not recording times to the sub-second. The best solution may thus be to use a simpler date/time class that does not include time zone information. Y

Re: [R] Selecting groups with R

2009-08-24 Thread Glen Sargeant
jlwoodard wrote: > > > Each of the above lines successfully excludes the BLUE subjects, but the > "BLUE" category is still present in my data set; that is, if I try > table(Color) I get > > RED WHITE BLUE > 82 151 0 > > How can I eliminate the BLUE category completely so I can do

Re: [R] table function

2009-08-24 Thread Glen Sargeant
Inchallah Yarab wrote: > > i want to do a table summerizing the number of variable where z is in > [0-1000],],[1000-3000], [> 3000] > You can use "cut" to create a new vector of labels and tabulate the result. Options control closed/open endpoints (see ?cut): > z <- c(100,1500,1200,500,3500,

Re: [R] Re lative paths in R?

2009-07-30 Thread Glen Sargeant
See also file.path() and create.dir(). You can use them with getwd() and setwd() to specify and/or create subdirectories, relative to your current working directory. Handy because they allow you to create paths and directories with names derived within functions. For example, I have used them to

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: > > Newbie here. Many apologies in advance for using the incorrect lingo. > I'm new to statistics and VERY new to R. > > I'm attempting to "group" or "bin" data together in order to analyze them > as a combined group rather than as discrete set. I'll provide a simple > examp

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: > > Newbie here. Many apologies in advance for using the incorrect lingo. > I'm new to statistics and VERY new to R. > > I'm attempting to "group" or "bin" data together in order to analyze them > as a combined group rather than as discrete set. I'll provide a simple > examp

Re: [R] Converting a list to a data frame or columns at the least

2009-05-26 Thread Glen Sargeant
Farrel Buchinsky-3 wrote: > > I have a column in which dates and times are specified thus > m/d/ HH:MM:SS > Alas, some entries do not include the time and therefore are only > m/d/ > so I used read.csv and specified that the relevant column should be read > as > is and it remained as a

Re: [R] Maintain proportions while reducing graphic output size

2009-04-06 Thread Glen Sargeant
lawnboy34 wrote: > > Hello, > > Is there a combination of par() settings or other commands that will allow > me to uniformly reduce the size of graphics outputs? It appears that the > png() device outputs 5-inch by 5-inch images, and I am trying to change > my > whole script to produce 4x4 im

Re: [R] Calculating First Occurance by a factor

2009-04-01 Thread Glen Sargeant
pmatch() facilitates a very simple solution: #Data IA <- factor(c(1,2,2,3,3,4,3,5,5)) FixTime <- c(200,350,500,600,700,850,1200,1350,1500) #First occurrence of each level first. <- pmatch(levels(IA),IA) #Use first occurrence to subscript a vector or data frame FixTime[first.] A simple way to a