Displaying 20 results from an estimated 29 matches for "jamesrome".
2011 Jun 08
3
How to suppress factor labels
I am using ggplot2 to make a boxplot that overlays a scatterplot:
pp = qplot(time, error, data=times, size=I(1), geom="jitter", main=title,
ylab="Error (min)", xlab="Time before ON (min)", alpha=I(1/10),
color=times$runway,
ylim=c(-30,40))
pp2 = pp + with(times, facet_wrap(~ runway, ncol=2))
print(pp2 + geom_boxplot(alpha=.5,
2011 Aug 27
2
Am having trouble calling a function
...> sapply(ads, function(x) {doAirport(x, base)} )
Error in eval(expr, envir, enclos) : object 'lblx' not found
In addition: Warning message:
'mode(onefile)' differs between new and previous
==> NOT changing 'onefile'
What am I doing wrong?
Thanks,
Jim
E-mail: jamesrome at gmail.com
URL: http://jamesrome.net
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried
gatelist = unique(mdf$ArrivalGate)
for( gate in gatelist) {
outfile = paste("../", airport, "/", airport, "taxiHistogram", gate,
".pdf", sep="")
pdf(file = outfile, width = 10, height=8, par(lwd=1))
title=paste("Taxi time for Arrival Gate", gate, "by
2011 Jun 07
2
ggplot2 and facet
I have a data frame (attached) that has interpolated EOT errors for
each minute before flight landing. It also has the runway and an index
for the flight:
> > times[1:4,]
time error runway flight
1 0 -0.02206235 04R 1
2 1 -0.07961631 04R 1
3 2 -0.13795380 04R 1
4 3 -0.20726073 04R 1
> > sapply(times, class)
time error
2010 Jan 16
3
Comparing dates in dataframes
I have two data frames. One (arr) has all arrivals to an airport for a
year, and the other (gw) has the dates and quarter hour of the day when
the weather is good. arr has a Date and quarter hour column.
>names(arr)
[1] "Date" "weekday" "hour" "month" "minute"
[6] "quarter" "ICAO"
2010 Jan 18
3
Using the output of strsplit
I successfully combined my data frames, and am now on my next hurdle.
I had combined the data and quarter, and used tapply to count the
entries for each unique date/quarter pair.
ar= tapply(ewrgnd$gw, list(ewrgnd$dq), sum) #for each date/quarter
combination sums the gw (which are all 1)
dq=row.names(ar)
spl=strsplit(dq)
But I need to split them back into the separate date and quarter. So I
used
2011 May 25
2
Importing fixed-width data
I have a data set where the lines look like:
2011-05-13 00:00:00 EONAAL330 dfa13002516PSCNONA
2011-05-13 00:00:01 EONAAL223 laa13044510AS.NONM
Some lines are missing the field before and after the NON:
2011-05-13 00:00:05 EONBHS229 mia13001621NON
I read them into R using
df = read.fwf(file, widths=c(19,-4,7,3,8,2,1,3,1),
2010 Apr 16
6
bwplot puts the bars in the wrong place
Dear R-Help,
With the attached data set, I am still getting incorrect bwplots
> xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf) # Is correct
> bwplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf, horizontal=FALSE) #
Puts the boxes on the wrong x-axis values
# look especially at 0 and 3. How do I fix this?
What is happening?
Thanks,
Jim Rome
2010 Mar 20
3
How to select a row from one dataframe that is "close" to a row in another dataframe
I have two data frames of flight data, but they have very different
numbers of rows. They come from different sources, so the data are not
identical.
> names(oooi)
[1] "FltOrigDt" "MkdCrrCd"
[3] "MkdFltNbr" "DprtTrpnStnCd"
[5] "ArrTrpnStnCd" "ActualOutLocalTimestamp"
2011 May 24
2
escape characters in shell commands
On a Windows platform I am trying to count the number of lines in a file.
In a DOS window, the following works:
C:\Users\jar>findstr /R /N "^" D:\my_dir\my_file | find /C ":"
5317
(it works with double \\ also)
But in R, I need to make this string up with the file name I get from
file.choose():
filename = file.choose()
#get the number of lines in the file
# first make a
2009 Dec 30
1
What am I doing wrong in my loops?
Dear kind list people:
I have the following code:
>hours
[1] "0" "1" "2" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13"
"14" "15"
[16] "16" "17" "18" "19" "20" "21" "22"
2011 Jun 10
1
Double x grid in ggplot2
I am trying to overlay raw data with a boxplot as follows:
pp = qplot(factor(time, levels=0:60, ordered=TRUE),
error, data=dfsub, size=I(1), main =" title", ylab="Error
(min)",
xlab="Time before ON (min)", alpha=I(1/10),
ylim=c(-30,40), geom="jitter") +
facet_wrap(~ runway, ncol=2) +
2011 Jul 17
1
How to speed up interpolation
df is a very large data frame with arrival estimates for many flights
(DF$flightfact) at random times (df$PredTime). The error of the estimate
is df$dt.
My problem is that I want to know the prediction error at each minute
before landing. This code works, but is very slow, and dominates
everything. I tried using split(), but that rapidly ate up my 12 GB of
memory. So, is there a better R way of
2010 Feb 02
2
Writing out csv files
In my code, I calculate the maximum values with 2 factors using
maxr=with(arrdf, tapply(rate,list(weekday,quarter), max, na.rm=T))
and I want to write out the file so that Excel can read it.
I used
write.table(maxr, fname, sep=",", col.names=TRUE, row.names=TRUE,
quote=TRUE, na="0")
which works, and yields something like
2009 Dec 24
4
How to separate a data set by its factors
I have a large data set of airport data and wish to analyze it by hour
and day of the week. hour and day of the week are factors.
I can do something such as:
histogram(~(Arrival.Val) | DAY*Hour, type="count", breaks=60)
which displays the data the way I want it in principle, but the plots
are too small to read. I added layout=c(7,6,4) to the argument list, but
then I only get the first
2010 Apr 15
4
Does "sink" stand for anything?
Hello Everyone,
Learning about R and its wonderful array of functions. If it's not obvious, I usually try to find out what a function stands for. I think this helps me remember better.
One function that has me stumped is "sink." Can anyone tell me if this stands for something?
Thanks,
Paul
__________________________________________________
[[alternative HTML
2010 Jan 27
2
Rcmdr has stopped working
On my Mac (Snow Leopard and R64), I had been using Rcmdr nicely. But now
when I do
> library(Rcmdr)
the tk libraries load, but the Rcmdr window never appears.
> library(Rcmdr)
Loading required package: tcltk
Loading Tcl/Tk interface ...
>
And if I try to do anything else, R goes to 100% cpu and hangs.
How do I recover?
Thanks,
Jim Rome
2010 Apr 01
2
How to get the scale limits in lattice plot
I am drawing a density histogram, and want to label the plots with the
mean using ltext(). But I need the x,y coordinates to feed into ltext,
and I can't calculate them easily from my data. Is there a way to get
the x and y ranges being used for the plot, so I can put the text at the
correct position in the panel.function?
Thanks,
Jim Rome
2009 Dec 26
1
Why do histogram bars vary their width?
histogram(~(Arrival4) | as.factor(Hour), type="count",
breaks=16,ylab="Arrival Count",
xlab="Arrival Rate/4",main="Friday EWR A22R D22L Configiration",
layout=c(6,4), par.strip.text=list(cex=0.7))
Why do I get plots with different bar widths? See attached.
Thanks,
Jim Rome
-------------- next part --------------
A non-text attachment was scrubbed...
2009 Dec 31
0
How to annotate lattice plots
I am creating a lattice plot with
with(ordgdp, xyplot(delivery~AAR | GDP_ID, xlab="AAR", ylab="Actual
Arrival Rate"))
which works, and gives me 48 plots, one for each GDP_ID.
But I would like to put the number of hours that each GDP lasted on the
relevant plot. This is given by the following table:
>gdphrs
GDP_ID
21273 21288 21293 21294 21297 21303 21361 21399 21415 21436