similar to: Need advise in grab the line number of sorted list in R

Displaying 20 results from an estimated 11000 matches similar to: "Need advise in grab the line number of sorted list in R"

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 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    
2005 Oct 27
1
Bind failed on Port xxx Socket error
Hi All, When I tried to start the SMBD service it was saying "not found", thanks to this forum, I got answer, saying I should type ./ smbd When I did that, I didn't get any error, it went to anohter line (:/usr/local/samba/sbin) But I don't why I'm not able to access the directory where my files are resides. When I typed "ps -ef | grep smbd" it shows
2007 Apr 20
2
sorting data in R
hello, I'd like know how to sort a data frame in R for example how I should do to sort by Catholic with swiss data frame like below thanks Fertility Agriculture Examination Education Catholic Infant.Mortality Courtelary 80.2 17.0 15 12 9.96 22.2 Delemont 83.1 45.1 6 9 84.84 22.2
2008 Dec 21
2
data format issue
Dear all- I have a dataset (see a sample below - but the whole dataset is June 2005 - June 2008). The "LST" format is "YYMMDDHHmm" and I would like to get the hourly average of the "mph" for the summer months (spanning all years). I have been trying to use "aggregate" but am not having much success at all! any thoughts would be greatly appreciated.
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
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
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))
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). :..... ..:::::::::. .:::::::::::::::
2009 Dec 07
1
Subset of time observations where timediff > 60 secs
Dear list members I have a rather large vector (part of a data frame) giving the time (date + time, POSIXct) of observations. The times are irregular (with both small and large jumps) but increasing, and there are several millions of them. I now wish to reduce my data set, so that I only have observations which are at least (for example) 60 seconds apart. Basically, I need (all) the indices
2009 Jun 22
1
The gradient of a multivariate normal density with respect to its parameters
Does anybody know of a function that implements the derivative (gradient) of the multivariate normal density with respect to the *parameters*? It?s easy enough to implement myself, but I?d like to avoid reinventing the wheel (with some bugs) if possible. Here?s a simple example of the result I?d like, using numerical differentiation: library(mvtnorm) library(numDeriv) f=function(pars, xx, yy)