Displaying 20 results from an estimated 3000 matches similar to: "Print lattice output to table?"
2010 Aug 10
3
sapply/lapply instead of loop
Using the input below, can I do something more elegant (and more efficient)
than the loop also listed below to pad strings to a width of 5? The true
matrix is about 300K rows and 31 columns.
#######################
#INPUT
#######################
> temp
DX1 DX2 DX3
1 13761 8125 49178
2 63371 v75 22237
3 51745 77703 93500
4 64081 32826 v72
5 78477 43828 87645
>
2011 Jun 24
2
SQL Changing Data Type
Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried
setting back to a Date via as.Date, but get an error the error: character
string is not in a standard unambiguous format. Any thoughts appreciated.
Code/Results listed below:
> summary(df.possible.combos)
Date Hour
Min. :2011-03-01 Min. : 0.00
1st Qu.:2011-03-23 1st Qu.: 5.75
2010 Jun 28
6
Basic question - more efficient method than loop?
I'm guessing there's a more efficient way to do the following using the index
features of R. Appreciate any thoughts....
for (i in 1:nrow(dbs1)){
if(dbs1$Payor[i] %in% Payor.Group.Medicaid) dbs1$Payor.Group[i] =
"Medicaid"
if(dbs1$Payor[i] %in% Payor.Group.Medicare) dbs1$Payor.Group[i] =
"Medicare"
if(dbs1$Payor[i] %in% Payor.Group.Commercial)
2010 Nov 01
1
sqldf hanging on macintosh - works on windows
Have a long script that runs fine on windows (32 bit). When I try to run in
on two different macs (64 bit), however, it hangs with identical behavior.
I start with:
library(sqldf)
This results in messages:
Loading required package: DBI
Loading required package: RSQLite
Loading required package: RSQLite.extfuns
Loading required package: gsubfn
Loading required package: proto
Loading required
2010 Aug 10
3
Intersecting list vs rows in matrix
Know that if I have List_1 and List_2 that I can check to see if the
intersect via the code below:
List _1:
a, b, c, d, e, f, g
List_2:
z, y, x, w, v, u, b
length(intersect(List_1, List_2)) > 0
return = true
If instead I wanted to check a dataframe that is a "list of lists," how
would I do that by record without looping?
List _1:
a, b, c, d, e, f, g
List_2:
z, y, x, w, v,
2010 Jun 21
2
Return value associated with a factor
I am using the code below to extract census tract information.
save.tract$state, save.tract$county and save.tract$tract are returned as
factors. In the last three statements, I need to save the actual value of
the factor, but, instead, the code is yielding the position of the factor.
How do I instead return the value of the factor?
By way of example, for Lon=-82.49574 and Lat=29.71495, the code
2010 Jan 25
3
question on sqldf syntax
trying to structure sql to merge two datasets. structure follows:
dbs.possible.combos (all possible combinations of dates and places)
Date Place
1/1/10 N-01
1/1/10 S-02
1/2/10 N-01
1/2/10 S-02
etc...
dbs.aggregate (the raw data aggregated by date and location)
Date Place Days
1/1/10 N-01 6
1/1/10 S-02 10
1/2/10 S-02 5
Trying to merge so I look-up the values for each possible combo
dbs.final
2010 Aug 03
4
REmove level with zero observations
If I have a column with 2 levels, but one level has no remaining
observations. Can I remove the level?
Had intended to do it as listed below, but soon realized that even though
there are no observations, the level is still there.
For instance
summary(dbs3.train.sans.influential.obs$HAC)
yields
0 ,1
4685,0
nlevels(dbs3.train.sans.influential.obs$HAC)
yields
[1] 2
drop.list <- NULL
2008 Sep 18
1
outlier and whisker in boxplot
Hi, Dear R-users:
Sorry for bothering your guys again. I think I should rewrite my question.
I know how to extend whisker by using range. The question is that I will set
the range=1.5, and at the same time, I only want to show the extreme
outlier, like 0.01% and 99.99% percentile, so what should I do?
Thank you very much!
Catherine
--
View this message in context:
2008 Jan 31
1
how to customize boxplot
Dear List,
I'd like to make boxplots of a large number of observations (+/-
20.000), which are distributed log-normal and right skewed. The
problem is that with standard boxplots a too large number of
observations are displayed as outliers. I also tried to display the
log of the observations, but even then there are to may outliers to my
taste. So I'd like to change the standard IQR box
2008 Sep 18
1
about the whisker in boxplot
Hi, Dear R-users,
I have a problem when I drawing a boxplot. I want to extend the whisker to
the 5% and the 95% quantiles and only show the most extreme outlier, like
0.01% and 99.99% percentiles. What should I do?
I saw something on boxplot.stat, but even I define the parameter in
boxplot.stat, what I should do next? how to connect it to boxplot?
Thank you very much!
Catherine
--
View
2005 Nov 21
1
modify boxplot
Hi everybody,
I'm trying to modify the boxplot just to set the upper
whisker to the 90 percentile value, but I still
couldn't find the solution.
Can anyone help me?
Thanks
Alessandro Carletti
2004 Sep 01
1
AW: Looking for help in calculating percentiles
How do I calculate the 95th percentile when I know the 25th, the median and the 75th??
Thanks,
Harmony Tenney
[[alternative HTML version deleted]]
2008 Jun 13
2
Quartile regression question
I have data that looks like
lake,loglength,logweight
1,2.369215857,1.929418926
1,2.426511261,2.230448921
1,2.434568904,2.298853076
1,2.437750563,2.298853076
1,2.442479769,2.230448921
1,2.445604203,2.356025857
...
102,2.722633923,3.310268367
102,2.781755375,3.502153893
102,2.836324116,3.683407299
102,2.802773725,3.583312152
102,2.790285164,3.546419267
102,2.806179974,3.599118565
2011 Mar 27
1
Bootstrap 95% confidence intervals for splines
There appear to be reports in the literature that transform continuous
independent variablea by the use of splines, e.g., assume the dependent
variable is hot dogs eaten per week (HD) and the independent variable is
waistline (WL), a normal linear regression model would be:
nonconfusing_regression <- lm(HD ~ WL)
One might use a spline,
confusion_inducing_regression_with_spline <- lm(HD
2012 Sep 29
3
Removing lower whisker in boxplot to see the effects of the high values
Good Afternoon-
I was wanting to alter the boxplot to remove the lower whisker, both the
whisker line and staple just on the lower end. Is there a way to do this?
As my code is currently:
boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE,
whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log
Load",xlab="Climate Scenarios")
2008 Nov 10
1
Preparing data for display
I have a dataset of about 10^6 rows, each consisting of a timestamp,
several factors, a string, some integers, and some floats.
I'd like to graph this data in various ways, including straightforward
ones (how many events per week over the past year for each of 4 values
of some factor), some less straightforward. I've managed to do this
by brute force, but I'd like to learn how to do
2010 May 09
2
changing parameters of the box and whisker plot
Hello:
I am plotting some data using the box and whisker plot. However, I only want to plot the median, max and min, as I only have these values and not the quartile values. It seems R arbitrarily constructs the box margins to be halfway between the median and the max/min. How do I make the box and whisker plots without the box values?
Thanks,
Michael
[[alternative HTML version
2011 Jun 02
2
shading in overlap between two ranges
I have 2 datafiles 'target' and 'observed' as shown below (I will gladly
email these 2 small files to whomever). X25. And X75. Indicate the
value of 25th and 75th-percentile of the target ('what should be') and
the observed ('what is'). The i.value is simply the month.
> target
X i.value X25. X75.
1 one.month 1 10.845225 17.87237
2
2003 May 11
2
what does boxplot draw?
Dear r-help,
Unfortunately I cannot find in the documentation what determines
ranges of a 'box' in the box-and-whisker plot.
It is said in "Simple R" (http://www.math.csi.cuny.edu/Statistics/R/simpleR)
that they are 1st and 3rd Qus usually.
I tried to add to boxplot lines with (quantile(x,probs=0.25)), but
lines do not coincide with edges of boxes.