similar to: One basic question - combining two conditions

Displaying 20 results from an estimated 10000 matches similar to: "One basic question - combining two conditions"

2009 Nov 30
6
Learning R
Dear R helpers, Almost 15 days back I have become member of this very active and wonderful group. So far I have been only raising  queries and in turn got them solved too and I really thank for the spirit this group member show when it comes to the guidance. I wish to learn R language and I have given 2 months time for this. Can anyone please guide me as how do I begin i.e. from basics to
2010 Apr 19
2
Truncated Normal Distribution and Truncated Pareto distribution
Dear R helpers, I have a bimodal dataset dealing with loss amounts. I have divided this dataset into two with the bounds for the first dataset i.e. dataset-A being 5,000$ to 100,000$ and the dataset-B deals with the losses exceeding 100,000$ i.e. dataset-B is left truncated. I need to fit truncated normal disribution to dataset - I having lower bound of 5000 and upper bound of 100,000. While I
2009 Nov 27
2
Overlapping x - axis lables
Dear R helpers Suppose I am plotting a simple scatter plot where no of paired observations (x,y) are say 100. month          length 1                   10 2                   12 3                   17 4                   21 5                   13 .......................... .......................... .......................... 100              16 when i run the command plot(month, length)
2009 Nov 24
1
Old Version of R - packages
Hi! Unfortunately the version loaded on the office server is 2.6.0 (for some undisclosed so called policy decision by my adamant IT dept. who are not willing to upgrade), I need to use YieldCurve package compatible with this version. On my standalone machine I have R 2.9 loaded and hence I have no problem in using the YieldCurve package. (a) Kindly guide how do I download the version of
2006 Sep 12
1
lattice cloud and conditional axis limits
I'm using the 'cloud' function in the 'lattice' package to produce multi-panel 3D scatter plots. The range of the values used vary much between each panel (especially on the z axis), so I wish the axis limits to be calculated based on the (conditional) data. Here's a minimal example: library(lattice) z=1:200 x=runif(200) y=runif(200) s=factor(rep(c(1,2),each=100))
2009 Nov 13
4
processing log file
Dear all, I'm trying to process a log file which logs the date, the username and the computer number accessed. The table looks like this: >table.users          Date UserName Machine 1  2008-11-25     John     641 2  2008-11-25    Clive     611 3  2008-11-25   Jeremy     641 4  2008-11-25     Walt     722 5  2008-11-25     Tony     645 6  2008-11-26     Tony     645 7  2008-11-26    
2009 Nov 11
1
Polynomial fitting
Dear R helpers     Suppose I have a following data   y  <- c(9.21, 9.51, 9.73, 9.88, 10.12. 10.21)   t  <- c(0, 0.25, 1, 3, 6, 12)   I want to find out the polynomial which fits y in terms of t i.e. y = f(t) some function of t.   e.g.   y = bo + b1*t + (b2 * t^2) + (b3 * t^3) + ...... and so on.   In Excel I have defined y as independent variable, then defined t, t^2 and t^3 and using
2013 Feb 08
3
Border width on symbols plotted with the lattice package
Dear list members, I can't figure out how get 'xyplot' or 'dotplot' in the 'lattice' package to respect the 'lwd' value for specifying the border with for *symbols* (for lines it works fine). Example: ----- # Base graphics works fine (gives a 'fat? circle) plot(5, cex=10, pch=21, lwd=10) # But 'xyplot' or 'dotplot' doesn't
2009 Oct 05
2
Long for Loop- calling C from R - Parallel Computing
Hello everyone, I'm running the following for loop to generate random variables in chunks of 60 at a time (l), here h is of order in millions (could be 5 to 6 millions), note that generating all the variables at once could have an impact on the final results for(j in 1:h){ dat$t.o[seq(0,g1,l)[j]+1:l]<-dat$mu[seq(0,g1,l)[j]+1:l] + rnorm(l,0,dat$g.var[seq(0,g1,l)[j]+1:l]) } Is there any
2009 Mar 20
2
Accuracy of R and other platforms
Hi, The paper @ARTICLE{AlmironSilvaMM:2009, author = {Almiron, M. and Almeida, E. S. and Miranda, M.}, title = {The Reliability of Statistical Functions in Four Software Packages Freely used in Numerical Computation}, journal = {Brazilian Journal of Probability and Statistics}, year = {in press}, volume = {Special Issue on Statistical Image and Signal Processing}, url =
2009 Oct 19
2
Possible bug in plot.POSIXct regarding x axis
I believe I have found a bug (or at least a misfeature) in plot.POSIXct. See the following example code. set.seed(1) x=seq(1,1e8,length=100)+round(runif(100)*1e8) y=as.POSIXct(x,origin="2001-01-01") plot(y) This plots some random (date)times against their indices. The y axis correctly shows appropriate values (years), but the x axis contains the single number '59:58' in the
2011 Feb 02
3
Applying multiple functions to one object
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply?) somewhere. Example: If the function was named ?fun? the output of fun(3.14, mode, typeof, class) would be identical to the output of c(mode(3.14), typeof(3.14), class(3.14)) Is my memory failing me, or does such a function already exists in a
2008 Apr 22
2
Getting rid of borders on semi-transparent plotting symbols
R version 2.7.0 RC (2008-04-20 r45403) When using semi-transparent filled plotting symbols, the border of the symbol has a different (darker) colour than the interior: plot(0, 0, pch=19, col="#FF000022") (Saving this as a PDF and looking at it magnified may make it easier to see.) This is pretty annoying, since when plotting partially overlapping points, the border colour dominates,
2009 Oct 30
2
data.frame extracting data row-wise
Dear All, I am struggling with extracting data from a data frame: x=data.frame(a=1:11,b=100:110) What I want is a list/vector in this sence: 1 100 2 101 3 102... For single rows, this works fine: as.matrix(x)[1,] For, say 2 rows, this works fine: z=c(as.matrix(x)[1,],as.matrix(x)[2,]) But z=c(as.matrix(x)[1:2,]) gives 1 2 100 101!? Is there an 'automated way' to produce a
2007 Jul 13
1
Choosing the number of colour breaks in ggplot2
A seemingly simple problem has me stumped. Is it possible to choose the number of colour breaks for a gradient scale in the current version of ggplot2? Here is a simple example: --------------------------------------------- x=-10:10 y=-10:10 dat=expand.grid(x=x,y=y) dat$z=dat$x^2+dat$y^2-100 ggplot(dat, mapping=aes(x=x, y=y, fill=z)) + geom_tile() + scale_fill_gradient2()
2009 Dec 10
3
How to figure out which the version of split is used?
There are a number of functions that are dispatched to from split(). > methods('split') [1] split.data.frame split.Date split.default split.POSIXct Is there a way to figure out which of these variants is actually dispatched to when I call split? I know that if the argument is of the type data.frame, split.data.frame will be called? Is it the case that if the argument is not
2007 Jul 16
2
Different axis limits for each facet in ggplot2
Hi! Is it possible to have different axis limit for each facet in a ggplot2 plot? Here is an example: -------------------------------------------------------------- library(ggplot2) x=seq(-10,10,.1) y=cos(x) z=sin(x)*10 dat=melt(data.frame(x,y,z), id.var="x") qplot( x, value, data=dat, facets=variable~., geom="line" )
2009 Oct 30
1
Applying a function on n nearest neighbours
I'm having a problem where I have to apply a function to a subset of a variable, where the subset is defined by the n nearest neighbours of a second variable. Here's an example applied to the 'iris' dataset: $ head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4
2009 Nov 25
1
Kerning issues with CairoPDF
Dear list members I'm using CairoPDF to generate PDF (because of its font embedding and support for transparent colours). However, at least on my (Windows) system, the text it outputs seems to have completely wrong kerning. Here's an example: CairoPDF("test.pdf") plot(rnorm(100),xlab="Ovreset") dev.off() The v is (slightly) too far away from the O, it's much
2008 Apr 15
1
Text-based graphics/plots
When discussing statistics in e-mail based discussion groups, or in newsgroups, it is sometimes useful to include simple, text-based statistical graphics. Here is an example, a histogram (only useful with a fixed-width font, obviously). :..... ..:::::::::. .:::::::::::::::