similar to: Average over data sets

Displaying 20 results from an estimated 2000 matches similar to: "Average over data sets"

2009 Oct 25
3
Importing data from text file with mixed format
Hi, I'm having difficulty importing my textfile that looks something like this: #begin text file Timepoint 1 ObjectNumber Volume SurfaceArea 1 5.3 9.7 2 4.9 8.3 3 5.0 9.1 4 3.5 7.8 Timepoint 2 ObjectNumber Volume SurfaceArea 1 5.1
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling sums". (I have seen the Rmetrics package and the rollMean function and I would like to do the same thing except Sum instead of Mean.) I imagine someone has done this, I just can't find it anywhere. Example: x <- somevector #where x is 'n' entries long #what I would like to do is: x1
2010 Dec 23
5
Writing a single output file
Dear R helpers! Let me first wish all of you "Merry Christmas and Very Happy New year 2011" "Christmas day is a day of Joy and Charity, May God make you rich in both" - Phillips Brooks ## ---------------------------------------------------------------------------------------------------------------------------- I have a process which generates number of outputs. The R code
2008 Mar 07
3
Error
Hello! I need some help, because I don't know how this error means: Error: variables ?Output1?, ?Output2?, ?Output3?, ?Output4?, ?Output5? were specified with different types from the fit Execution halted Can you help me? Thank You
2007 Jun 19
1
A question about plots and lists in functions
R-helpers: I tried googling and couldn't find anything. I have a function I am sourcing into R that does some calculations to generate a simulated dataset. I currently have a a list set up to store the outputs from the function and a plot of one of them (a set of ordered pairs) like this: foo<-function(x,y,z){ ## do some work here ## list(x=x,y=y,z=z,output1=output1,output2=output2,
2008 Feb 01
3
Converting a character string into an object variable
R-helpers: Assume that I want to create a series of sequentially named R objects. For example, I might want to call these objects V1, V2, V3 ... V50. To do this, I thought of some sort of looping function like: input.value <- seq(1:50) * 3 for(i in 1:50){ paste("V", i, sep="") <- input.value[i] } Of course this loop will not work since the paste function
2012 Oct 11
2
Repeating a series of commands
I'm trying to figure out how to repeat a series of commands in R and have the outputs added to a dataframe after each iteration. My code starts this way... a<-read.csv("File1.csv") b<-read.csv("File2.csv")
2010 Nov 15
3
merge two dataset and replace missing by 0
Hi r users, I have two data sets (X1, X2). For example, time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,211 ) outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26 ,15 ,12 ,6 ,2 ,1 ) X1<-cbind(time1,outpue1) time2<-c( 0 ,8 ,15 , 22 ,43 , 64 ,85 ,106 ,148) output2<-c( 5 ,5 ,4 ,5 ,5 ,4 ,1 ,2 , 1 ) X2<-cbind(time2,output2) I want to
2009 Aug 10
3
how use cat() function?
i  want to print in the console and to have an excel file like this no_GWP                NbOfPolicyClass1[0-1000]     NbOfPolicyClass2[1000-3000]        NbOfPolicyClass3[> 3000] No_GWPMax=8    NbpolicyClass1=5                   NbpolicyClass2=4                            NbpolicyClass3 =3              i have do it like this:!!! data1 <-
2004 Jan 07
4
Ogg checksum thingie needed
I need some sort of utility to calculate a checksum of an Ogg file. Two differently encoded Ogg:s should give different checksums, but the same file with different tags should give the same result. (The serial number doesn't work here, obviously. I need something that is changed if a bit of the file is lost.) -- Björn Lindström <bkhl@elektrubadur.se> http://bkhl.elektrubadur.se/
2005 Feb 08
2
batch jobs question
Hi,there I'm doing some R batch jobs in Unix. Something like R <prog1> output1 --save & R <prog2> output2 --save & prog1 and prog2 are running at the same time and they are essentially same except it contains different parameter values. I was wondering if two processes will affect each other? Hopefully they are two independent jobs. It's a beginner's question
2009 May 19
4
nlrwr package. Error when fitting the optimal Box-Cox transformation with two variables
Dear all: I'm trying to fit the optimal Box-Cox transformation related to nls (see the code below) for the demand of money data in Green (3th Edition) but in the last step R gives the next error message. Error en `[.data.frame`(eval(object$data), , as.character(formula(object)[[2]])[2]) : undefined columns selected. ?Any idea to solve the problem? Thanks in advance,
2008 Jul 21
1
Howto Restart A Function with Try-Error Catch
Hi all, I have a function - let's call it "myfunction". This function is based on some random number generator. Now, once in a while the function will break/crash depending on the random number it generate inside the function. To avoid the problem, what I intend to do is the following: 1. Catch the try-error using class. 2. Redo the function if it returns "try-error" 3.
2015 May 04
2
Define replacement functions
Hello I tried to define replacement functions for the class "mylist". When I test them in an active R session, they work -- however, when I put them into a package, they don't. Why and how to fix? make_my_list <- function( x, y ) { return(structure(list(x, y, class="mylist"))) } mylist <- make_my_list(1:4, letters[3:7]) mylist mylist[['x']] <- 4:6
2010 Mar 03
1
List of zoo dataframes
Hello, I have various datasets of zoo time series (merged into single frames via the "merge" command) such as date var0 var1 var2 var3 08/07/1996 652.54 0.223922 0.515819 0.502638 08/08/1996 662.59 0.997841 0.000383 0.999806 06/09/1996 655.68 0.901685 0.569763 0.866333 08/10/1996 700.64 0.268855 0.244701 0.329285 08/11/1996 730.82 0.438407 0.501427 0.461374
2009 Oct 25
3
NULL elements in lists ... a nightmare
I can define a list containing NULL elements: > myList <- list("aaa",NULL,TRUE) > names(myList) <- c("first","second","third") > myList $first [1] "aaa" $second NULL $third [1] TRUE > length(myList) [1] 3 However, if I assign NULL to any of the list element then such element is deleted from the list: > myList$second <-
2007 Oct 20
1
Getting at what a named object represents in a function...
Hi, I'm pretty new to R. I have an object (say a list) and I I have a function that I call on various columns in that list (excuse terminology if it's wrong/ambiguous). Imagine its like this (actual values are unimportant) and called mylist: >mylist A B 1 5 2 5 3 6 4 8 5 0 I have a function: foo = function(param){ #modify list A or B values depending on
2004 May 10
2
Lists and outer() like functionality?
Hi, I'm have a list of integer vectors and I want to perform an outer() like operation on the list. As an example, take the following list: mylist <- list(1:5,3:9,8:12) A simple example of the kind of thing I want to do is to find the sum of the shared numbers between each vector to give a result like: result <- array(c(15,12,0,12,42,17,0,17,50), dim=c(3,3)) Two for() loops is the
2011 Apr 05
1
Help in splitting a list
Dear R users, Let's say I have a list with components being 'm' matrices (as exemplified in the "mylist" object below). Now, I'd like to subset this list based on an index vector, which will partition each matrix 'm' in 2 sub-matrices. My questions are: 1. Is there an elegant way to have the results shown in mylist2 for an arbitrary number of matrices in mylist?
2017 Jun 15
4
is.null(mylist[1]) and is.null(mylist$a) returns different values
Hi I have a list : mylist <- list( a = NULL, b = 1, c = 2 ) > mylist[1] $a NULL > is.null(mylist[1]) [1] FALSE > is.null(mylist$a) [1] TRUE why? I need to use mylist[1]