similar to: order matrix by column position

Displaying 20 results from an estimated 4000 matches similar to: "order matrix by column position"

2009 Oct 08
2
lattice: passing multiple lty values to the key/legend
hi all, It's not clear to me how (or if) I can pass multiple values for lty to a key in xyplot? I've tried: lines=list(lty=1:3), to no avail. Do I need to use something other than auto.key? (Deepayan, if you're out there, I have your book and must admit the answer isn't jumping out at me.) thanks in advance! Michael Folkes example code: #____________________________
2013 Sep 09
1
Hmisc binconf function value interpretation during narrow confidence intervals
Hello all, I've been using binconf (package Hmisc) at a range of alpha values and noticed that using the 'Wilson' method when alpha is larger (i.e. narrow CI), results in the upper value being smaller than the lower value. The 'exact' and 'asymptotic' methods give results in the realm I'd expect. But the help file suggests: "Following Agresti and Coull, the
2011 Aug 17
3
Convert week value to date
Hello all, I'm hoping to convert a decimal value for week of the year back to a date object. Eg: strptime(paste(2010,1:52,sep=" "),format="%Y %W") I expected (hoped?) this would give me the date for Monday of each week. Instead, it's giving me 52 values of today's date. Where am I erring? Thanks Michael _______________________________________________________
2011 Mar 04
4
Floating points and floor() ?
Perhaps somebody could clarify for me if the following is a floating point matter or otherwise, and how am I to correct for it? > floor(100*.1) [1] 10 > 100*(1.0-.9) [1] 10 > floor(100*(1-0.9)) [1] 9 Thanks! Michael _______________________________________________________ Michael Folkes Salmon Stock Assessment Canadian Dept. of Fisheries & Oceans Pacific Biological Station
2011 Apr 04
2
RODBC excel - need to preserve (or extract) numeric column names
I'm using RODBC to read an excel file (not mine!). But I'm struggling to find a way to preserve the column names that have a numeric value. sqlFetch() drops the value and calls them f1, f2, f3,... (ie field number). this is a different approach from read.csv, which will append "V" prior to the numeric column name. sqlFetch isn't so helpful. Is there a way to get the
2011 Sep 24
2
maptools::sunriset() daylight savings to stardard time change
Hello all, After beating my head against the wall for a few hours, I give up. I have two problems. 1. If I use seq() to generate a POSIXct series that crosses a daylight savings to stardard time change I get two values for the first day of change. The time change is Nov 6,2011. The value for Nov 7 turns into 23:00 on Nov 6, thus two values for Nov 6. (see below) So I put a time value (noon)
2008 Nov 04
1
contour plot, failing to interpolate through all data
I'm having trouble making contour lines for this attached, sparse dataset (low data:NA ratio!). Is it the high number of NA's, or funny layout of the densities, or something else that's causing this? This is a subsample of the dataset, and I get the same problem when using the full data. The only reason I get any contours is because I'm forcing specific levels. If no levels are
2007 Oct 31
1
Lattice: par.ylab.text alpha ?
Hi all, I've got R for windows 2.3.1 I'm trying to modify my lattice histograms. The following does reset the y-label to blue, but I cannot turn off the label (alpha=0), nor shift label position (I'm assuming that is what lineheight is for). Is 'lineheight' the equivalent of 'line' in mtext? Am I erring somehow? Thanks!
2007 Jul 10
2
Plot SpatialLinesDataFrame with xlim & ylim
I'm running windows xp, R 2.3.1 with maptools 0.6-6, I guess. When plotting from a large SpatialLinesDataFrame and using xlim & ylim to reduce the area, the plot axes automatically have the same scale size, even if xlim and ylim ranges differ. E.g.: tmp <- readShapeLines(filepath) plot(tmp,xlim=c(-126,-119),ylim=c(50,51)) The y-axis range is actually 47-54, same range as the x-axis.
2013 Mar 12
2
funtion equivalent of jitter to move figures on device
hello all, I'm overlaying numerous scatter plots onto a map (done in PBSmodelling). In this case I'm placing each plot by setting par(fig) to the centroid of map polygons. The location/mapping part is not so important. There are cases of small overlaps for some plots (ie figures) so I'm keen to write or find a function that moves my small scatter plots so they don't overlap. A
2009 Oct 08
1
problem understanding factor levels for use lattice panel order
Hello all, In order to get the desired order of panels within lattice I realized I needed to define my factor levels. I now see how to properly do it (attached code), but: 1. I don't understand why I have to use factor() on a variable that is already a factor, and why levels() alone doesn't work to readjust the level order. 2. I just noticed that if I do use levels(xx$v1), it's
2012 Mar 13
1
Amount of memory occupied by data type
Hello all, I was under the (false?) assumption that an object that is class logical, would take up less memory than an object with class integer. Below am I correctly showing this is not the case? This was an attempt to reduce memory usage. I'm dealing with two large arrays (could be integers). Their contents are the exact same, but one has NA's in random locations. I thought instead
2004 Jun 15
2
S/R/RWeb/ODBC
I'm looking for an optimal approach to access Oracle databases via RWeb applications. I'm new to R but familiar with programming functions and web pages for the S+ Statserver. I'm now going through the motions of migrating S+/Statserver applications to R/RWeb as a feasability exercise. I can access databases using ODBC directly in R or S, and using Statserver, but I have not succeeded
2011 Sep 26
0
as.POSIXct and time zones
Hello all, I'm struggling with POSIXt objects. I've read the refman, the Rnews from 2001 and hopefully all the pertinent help pages. I'm running windows xp. It appears my time zone variable isn't set, which hopefully is fine for this exercise. > Sys.getenv("TZ") TZ "" help(as.POSIXct) states: "Dates without times are treated as being at midnight
2011 Oct 20
0
Apply approx() to an array and eventually a list of arrays
Hello all, I'm struggling to grasp how I might use lapply() instead of looping to run approx() on a list consisting of multiple arrays - each of equal dimension. But simpler than that, I haven't been able to successfully apply approx() to an array, unless I loop through the third dimension and extract the matrix. See example code below... Any suggestions will be gratefully received. Thanks
2007 Sep 13
1
Collapsing data frame; aggregate() or better function?
Hello r-help, I am trying to collapse or aggregate 'some' of a data frame. A very simplified version of my data frame looks like: > tester trip set num sex lfs1 lfs2 1 313 15 5 M 2 3 2 313 15 3 F 1 2 3 313 17 1 M 0 1 4 313 17 2 F 1 1 5 313 17 1 U 1 0 And I want to omit sex from the picture and just get an addition of num,
2005 Jan 06
6
"labels" attached to variable names
Hi, Can we attach a more descriptive "label" (I may use the wrong terminology, which would explain why I found nothing on the FAQ) to variable names, and later have an easy way to switch to these labels in plots? I fear this is not possible and one must enter this by hand as ylab and xlab when making plots. Thanks in advance, Denis Chabot
2004 Dec 01
3
Hexidecimal conversion
Help I can produce the hexidecimal equivalent of a decimal number but I am having a hard time reversing the operation. I'm good for hex representations to 159 and am close to extending to 2559. The archives are not clear on the existence of a function for this task. Is there one? Here is what I have got so far: #Good for hex values to "9F" as.decmode<-function(as.character(x)){
2008 Oct 17
1
Use of .First() in Mac OS X gui
Hi, I am having problems using .First() with the Mac OS X gui version of R 2.7.2 (under OS X 10.5.5); .First is ignored on startup. .First() does work in the command-line version of R under Mac OS X but my specific task requires the gui version. I can find no reference to this issue in the Mac OS X FAQ or in other manuals, does anyone have a solution for this? Thanks, Ian -- Ian Jonsen
2007 May 29
1
Partially reading a file (particularly)
Hello, I am trying to figure out if there exists some R command that allows one to be particularly selective when reading a file. I'm dealing with large fixed-width data sets that look like 539001.. 639001.. 639001.. ... 539002.. 639002.. ... Presently, I am using read.fwf to read an entire file, but I am interested only in reading those records beginning with 5. I have been unable to