search for: mosher

Displaying 20 results from an estimated 48 matches for "mosher".

Did you mean: moser
2011 Sep 12
5
Hourly data with zoo
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe. d <- rep(20110101,24) h <- seq(from = 0, to = 2300, by = 100) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) S <- chron(dates. = as.character(df$LST_DATE), times. = paste(as.character(df$LST_TIME/100), ":0:0", sep = ""), format =
2010 Apr 25
3
Noobie question on aggregate tapply and by
I have a 43MB dataframe ( 5 variables) and I'm trying to summarize subsets of the data. I've RTFM ( not very clear) and looked at a variety of samples but cant seem to figure out how to make these functions work. A sample of what I want to do would be this: ids<-seq(1,50) years<-c(rep(5,10),rep(6,10),rep(7,10),rep(8,20))
2002 Feb 12
1
openssh + pam errors (fwd)
...r a couple of weeks and everything seems good. i used to have to use uselogin yes and set the limits with login because openssh was broken, but this takes care of it. ---------- Forwarded message ---------- Date: Mon, 11 Feb 2002 23:05:54 -0500 From: Dug Song <dugsong at monkey.org> To: Rob Mosher <nyt at countercultured.net> Subject: Re: openssh + pam errors send this patch to openssh-unix-dev at mindrot.org Damien Miller maintains the OpenSSH-portable tree, he'll know what to do with it... -d. --- http://www.monkey.org/~dugsong/ --- old/session.c Sat Dec 1 18:37:08 2001...
2010 Jul 15
3
Summing over intervals
Given a matrix of MxN want to take the means of rows in the following fashion m<-matrix(seq(1,80),ncol=20, nrow=4) result<-matrix(NA,nrow=4,ncol=20/5) result[,1]<-apply(m[,1:5],1,mean) result[,2]<-apply(m[,6:10],1,mean) result[,3]<-apply(m[,11:15],1,mean) result[,4]<-apply(m[,16:20],1,mean) result [,1] [,2] [,3] [,4] [1,] 9 29 49 69 [2,] 10 30 50 70
2012 Sep 19
2
Rcmd check problem
Hi, all. I was trying to build my R package with R 2.15.1 32bit and win7. I basically follow the routine in Steven Mosher's blog http://stevemosher.wordpress.com/step-10-build/ After I fixed the path, and built the skeleton of the package, I started command prompt and used the following commands in building my package Rcmd check myPackageName Rcmd build myPackageName Rcmd check myPackageName.tar.gz Rcmd INSTA...
2011 Jun 22
2
First package submission to CRAN
I'm preparing to submit my first package to CRAN, thanks to the help of too many people to mention. I've built and checked the package on Windows ( making a zip) and my path points to the 64 bit version of R. Everything builds and checks and the final warnings have been fixed. My package is pure R with no source from other languages. My questions are as follows. I've read the
2010 Apr 18
2
Calculating a Maximum for a row or column with NA's
Is there a simple way to calculate the maximum for a row or column of a matrix when there are NA,s present. # given a matrix that has any number of NA per row > m<-matrix(c(seq(1,9)),nrow=3) > m [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 > m[3,1]=NA > m[1,]=NA > m [,1] [,2] [,3] [1,] NA NA NA [2,] 2 5 8 [3,] NA 6 9
2011 Jul 27
2
Elegant way to subtract matrix from array
there are really two related problems here I have a 2D matrix A <- matrix(1:100,nrow=20,ncol =5) S <- matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2 rows of #A, then the next two rows and so on. #I have a the same problem with a 3D array # where I want to subtract Q for every layer (1-10) in Z # I thought I solved this one
2011 Mar 18
2
Understanding tryCatch
I've read the help and the archives on tryCatch but I'm still stuggling trying to understand how it works exactly and how I can use it to get the result I need. I have a data.frame of urls which point to 11 .zip files. Basically I use RCurl to get the list of files from a ftp and then reduce that directory dump to the 11 zip files I want to download. Its easy enough to do that in a loop
2010 Dec 15
3
selecting certain rows from data frame
Hi, if I have a dataframe such that ID Time  Earn 1        1        10 1        2        50 1        3        68 2        1        40 2        2        78 2        4       88 3        1        50 3        2        60 3        3        98 4        1        33 4        2        48 4        4       58 ..... .... ..... Now if I have to select the all the rows from the data frame which does not
2010 May 03
2
Adding a header after the file is written
The situation arises where I open a file to write a data.frame to it. with write.table. multiple lines are written to the file and the file is kept in Append=TRUE mode. If one sets the col.names to the names of the variables being written, you have output that looks like this... name1 name2 name3..... x x x x x x x x x name1 name2 name
2011 May 27
2
help with barplot
Hi, I'm really struggling with barplot I have a data.frame with 3 columns. The first column represents an "incident" type The second column represents a "month" The third column represents a "time" Code for a sample data.frame incidents <- rep(c('a','b','d','e'), each =25) months <- rep(c(1,2), each =10) times
2010 Jun 10
2
counting Na/not NA by groups by column
# create a matrix with some random NAs in it > m<-matrix(NA,nrow=15,ncol=14) > m[,3:14]<-52 > m[13,9]<-NA > m[4:7,8]<-NA > m[1:2,5]<-NA > m[,2]<-rep(1800:1804, by=3) > y<-order(m[,2]) > m<-m[y,] > m[,1]<-rep(1:3,by=5) > m [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 1 1800 52 52 NA 52 52
2010 Aug 11
2
Sweeping a zoo series
Given a long zoo matrix, the goal is to "sweep" out a statistic from the entire length of the sequences. longzoomatrix<-zoo(matrix(rnorm(720),ncol=6),as.yearmon(outer(1900,seq(0,length=120)/12,"+"))) cnames<-c(12345,23456,34567,45678,56789,67890) colnames(longzoomatrix)<-cnames longzoomatrix[1:24,] 12345 23456 34567 45678
2010 Jun 05
5
Matrix to Vector
Given a matrix of m*n, I want to reorder it as a vector, using a row major transpose. so: > m<-matrix(seq(1,48),nrow=6,byrow=T) > m [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 2 3 4 5 6 7 8 [2,] 9 10 11 12 13 14 15 16 [3,] 17 18 19 20 21 22 23 24 [4,] 25 26 27 28 29 30 31 32 [5,] 33 34 35 36 37
2010 Sep 05
2
merging two maxtrices
j<-matrix(nrow=10,ncol=10) k<-matrix(seq(1:50), ncol=10) row.names(k) <- seq(2,10,by=2) j [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] NA NA NA NA NA NA NA NA NA NA [2,] NA NA NA NA NA NA NA NA NA NA [3,] NA NA NA NA NA NA NA NA NA NA [4,] NA NA NA NA NA NA NA NA NA NA [5,] NA
2010 May 04
1
error in La.svd Lapack routine 'dgesdd'
Error in La.svd(x, nu, nv) : error code 1 from Lapack routine ‘dgesdd’ what resources are there to track down errors like this [[alternative HTML version deleted]]
2010 Jun 14
1
recursively Merging a list a zoo objects
The zoo package as a merge function which merges a set of zoo objects result<-merge(zoo1,zoo2,...) Assume your zoo objects are already collected in a list # make a phony list to illustrate the situation. ( hat tip to david W for constructing a list in a loop) ddat <- as.list(rep("", 20)) ytd<-seq(3,14) for(i in 1:20) { + ddat[[i]] <- zoo(data,ytd ) + } ddat [[1]] 1 2
2010 Aug 09
1
nested 'by'
Assuming a data frame or matrix with two columns representing variable that you want to aggregate over. you want to calculate column means, by year, for each Id example<-data.frame(id=c(rep(12345,5),rep(54321,6),rep(45678,7)),Year=rep(seq(1900,1902,by=1),6), x=seq(1,18,by=1),y=seq(18,1,by=-1)) example id Year x y 1 12345 1900 1 18 2 12345 1901 2 17 3 12345 1902 3 16 4 12345
2010 Sep 21
1
diagnosing download.file() problems
I'm accessing around 95 tar files on an FTP server ranging in size between 10 and 40MB a piece. while certainly can click on them and download them outside of R, I'd like to have my script do it. Retrieving the ftp directory with RCurl works fine (about 90% of the time) but downloading the files by looping through all the files is a random process. I may get 1-8 files download and then