search for: john_d_mchenry

Displaying 17 results from an estimated 17 matches for "john_d_mchenry".

2006 Aug 10
3
Is there a better way than x[1:length(x)-1] ?
Hi WizaRds, In MATLAB you can do x=1:10 and then specify x(2:end) to get 2 3 4 5 6 7 8 9 10 or whatever (note that in MATLAB the parenthetic index notation is used, not brackets as in R). The point is that 'end' allows you to refer to the final index point of the array. Obviously there isn't much gain in syntax when the variable name is x, but when it's something like
2005 Dec 06
1
array of lists? is this the best way to do it?
[Q.] How to create an array of lists, or structures the most elegant way? There have been questions in the past but none too recently...I want to know if the following looks OK to you guys or if there is a better way to create an array of lists: # PREAMBLE ... JUST TO GET THINGS GOING makeList<- function(data, anythingElse) { rval <- list( data = data, anythingElse =
2006 Nov 28
1
Can anyone read a S-PLUS .dmp file for me?
Hi WizaRds, I tried reading the S-PLUS file ftp://ftp.research.att.com/dist/bayes-meta/hblm.dmp into R using data.restore("hblm.dmp") but I got an error: Error in attributes(value) <- thelist[-match(c(".Data", ".Dim", ".Dimnames", : row names must be 'character' or 'integer', not 'double' In
2007 Jan 25
2
Days of the week?
Hi WizaRds, What is the "standard" way to get the day of the week from a date such as as.Date("2006-12-01")? It looks like fCalendar has some functions but this requires a change in the R locale to GMT. Is there another way? Thanks! Jack. --------------------------------- Be a PS3 game guru. [[alternative HTML version deleted]]
2007 Mar 27
1
Source Code for zoo?
Hi, I downloaded the source code for the package zoo (zoo_1.2-2.tgz from CRAN). When I gunzip and untar the file I can't find the R / C / FORTRAN code for the library. In the R directory under zoo, the listing is for 3 files: zoo zoo.rdb zoo.rdx Is the code encoded in one of these files? I've had this problem with other packages too, trying to browse the source. Am I missing something
2006 Aug 01
1
Tcltk package
Hi WizaRds, I ran into trouble trying to install the "debug" package, which requires TCL/TK support. It seems like the tcltk package is not installed on my system. From: http://tolstoy.newcastle.edu.au/R/help/05/07/7993.html it seems that the tcltk is bundled with the base R distribution. I'm running R under linux: > version _ platform i686-pc-linux-gnu
2007 Sep 29
1
RODBC and Oracle
Hi WizaRds, I'm experiencing a problem connecting to an Oracle 10g database via RODBC (I'm getting this on Microsoft XP). The same SQL queries via PL/SQL Developer work just fine, but when I pump the query through sqlQuery in RODBC then I get a data frame back with 0 rows. I cut the query down alternating between PL/SQL and RODBC until I figured that it's some kind of row limit or
2006 Feb 28
2
Elegant way to express residual calculation in R?
Hi All, I am illustrating a simple, two-way ANOVA using the following data and I'm having difficulty in expressing the predicted values succinctly in R. X<- data.frame(read.table(textConnection(" Machine.1 Machine.2 Machine.3 53 61 51 47 55 51 46 52 49 50
2006 Jul 25
3
Overplotting: plot() invocation looks ugly ... suggestions?
Hi WizaRds, I'd like to overplot UK fuel consumption per quarter over the course of five years. Sounds simple enough? Unless I'm missing something, the following seems very involved for what I'm trying to do. Any suggestions on simplifications? The way I did it is awkward mainly because of the first call to plot ... but isn't this necessary, especially to set limits for the
2006 Aug 02
1
MATLAB 6.5 under Wine
Hi, I'm completely new to Wine (I'm running version 0.9.9 under Ubuntu 6.06). I have been able to install and run Windows apps and I can see that Wine really rocks! For speed, I'd rather run Wine than VMware, especially when it comes to running MATLAB under linux. I'm having difficulty with getting MATLAB (6.5.0.180913a (R13)) to run. There are several threads in the Wine
2007 Sep 13
2
Multivariate, multilevel regression?
Dear WizaRds, This is mostly a statistics question, but I'm figuring that R is the right solution (even before I start!) I have some bio data of heart rate versus time (rats taken from resting to maximal heart rate). I want to regress heart rate on time. The data have been normalized such that resting heart rate is zero at time=0, so that all curves intersect at the origin (and at the origin
2006 Mar 13
3
Incrementing a counter in lapply
Hi All, I'm looking for some hints on idiomatic R usage using 'lapply' or similar. What follows is a simple example from which to generalize my question... # Suppose, in this simple example, I want to plot a number of different lines in different colors; # I define the colors I wish to use and I plot them in a loop: d<-
2008 Mar 08
1
plotting NAs
Hi WizaRds, (I've cross-posted to r-sig-finance because a lot of people there use 'zoo' objects). I'm trying to plot 2 time series lined up with par(mfrow=c(2,1)), so that the time index is the same for the two series. The data have monthly frequency. An example will illustrate: # data for these dates (monthly frequency) do not have NAs: require(zoo) monthly.dates<-
2005 Dec 06
3
reading in data with variable length
I have very large csv files (up to 1GB each of ASCII text). I'd like to be able to read them directly in to R. The problem I am having is with the variable length of the data in each record. Here's a (simplified) example: $ cat foo.csv Name,Start Month,Data Foo,10,-0.5615,2.3065,0.1589,-0.3649,1.5955
2007 Jun 28
1
Method dispatch in functions?
Hi, Could someone point me in the right direction for documentation on the following question? Let's say I have two objects a and b of classes A and B, respectively. Now let's say I write a function foo that does something similar to objects of type A and B. Basically I want to overload the function in C++ talk, so if I give foo and object of type A something (and this is my question)
2009 Feb 04
0
Generic functions with models? 'predict', 'residuals', 'fitted', ...?
Hi WizaRds! I don't know if my understanding of models is screwed up or if there's a fundamental limitation to the way they are used in R. Here's what I'd like to do: create a model and then test data against that model using generics like 'predict' and 'residuals'. The problem is that generics don't work for new data sets, except of course 'predict':
2006 Mar 03
2
Command-line editing & history
Hi all, Are there any plans to add more functionality to command-line editing and history editing on the command line? In MATLAB (I know, comparisons are odious ...), you can type "p" and up-arrow on the command line and scroll through the recently entered commands beginning with "p". This is a very useful feature and something that I believe is not replicated in R. Please