similar to: Export Results to a txt file applying a function to a list

Displaying 20 results from an estimated 500 matches similar to: "Export Results to a txt file applying a function to a list"

2010 Aug 26
2
Problems when Apply a script to a list
Dear users, *******I have a function f to simulate data from a model (example below used only to show my problems) f<-function(n,mean1){ a<-matrix(rnorm(n, mean1 , sd = 1),ncol=5) b<-matrix(runif(n),ncol=5) data<-rbind(a,b) out<-data out} *********I want to simulate 1000 datasets (here only 5) so I use S<-list() for (i in 1:5){ S[[i]]<-f(n=10,mean1=0)} ******I have a
2010 Sep 04
2
Function try and Results of a program
Hello, users. Dear users, *******I have a function f to simulate data from a model (example below used only to show my problems) f<-function(n,mean1){ a<-matrix(rnorm(n, mean1 , sd = 1),ncol=5) b<-matrix(runif(n),ncol=5) data<-rbind(a,b) out<-data out} *********I want to simulate 1000 datasets (here only 5) so I use S<-list() for (i in 1:5){ S[[i]]<-f(n=10,mean1=0)}
2012 Dec 17
1
seeking a help on if function
Hello r helpers! Below is the whole coding for my programme. Before proceed more further, let me explain for you. First of all, I need to compute trimmed mean. Till that step is ok. Then I need to compute ssdw which is sum of square deviation. If I do equal trimming at both tail of distribution that I chose, I will use the first ssd formulae which is "a". But if I am doing unequal
2009 Mar 03
1
profiler and loops
Hello, (This is follow up from this thread: http://www.nabble.com/execution-time-of-.packages-td22304833.html but with a different focus) I am often confused by the result of the profiler, when a loop is involved. Consider these two scripts: script1: Rprof( ) x <- numeric( ) for( i in 1:10000){ x <- c( x, rnorm(10) ) } Rprof( NULL ) print( summaryRprof( ) ) script2:
2011 Nov 10
2
library(qpcR) cbind.na
I want to use function cbind.na at library(qpcR) I install package qpcR and I can use functions such m1 <- pcrfit(reps, 1, 2, l5) > AICc(m1) [1] -102.5843 but when i try cbind.na(1, 1:7) i take message Error: could not find function "cbind.na" Thanks -- View this message in context: http://r.789695.n4.nabble.com/library-qpcR-cbind-na-tp4023339p4023339.html Sent from the
2005 Jun 17
2
reading csv-data
Hi! I have had this problem for a long time. I have tried to study the manuals and search the mailing lists, but I can not solve this. I think there has to be one simple solution to this, but I just can not find it. I have saved the data in excel (csv-format). Then I read the data in R e.g. >data <- read.csv2("example.csv", header=TRUE) I look the data and it looks ok. E.g
2008 Sep 22
1
lme problems
Hi, I'm analysing a dataset in which the same 5 subjects (male.pair) were subjected to two treatments (treatment) and were measured for 12 successive days within each treatment (layingday). Overall 5*2*12=120 observations. I want to test the effect of treatment, time (layingday) and their interaction. I have done so through the ANOVA below: >
2011 Aug 22
3
Multiple regression in R - unstandardised coefficients are a different sign to standardised coefficients, is this correct?
Hello, I have a statistical problem that I am using R for, but I am not making sense of the results. I am trying to use multiple regression to explore which variables (weather conditions) have the greater effect on a local atmospheric variable. The data is taken from a database that has 20391 data points (Z1). A simplified version of the data I'm looking at is given below, but I have a
2010 Nov 23
1
Barplot and plot means with confidence intervals in the same plot
I want to obtain a barplot with error bars and a mean plot with error bars with other scale on the left in the same plot. I need help to get the same x axis (centered) when overlay two plots (barplot2 and plotCI (or lineplot.CI) with errorbars), with diferent y axis. I use par (new=T) but the X axis names are not centered with the figures. An example of my data:
1999 Mar 07
1
ANOVA f-test
I have a rather basic question. How can I get R to generate a ANOVA table and a f-value for a hypothesis test such as: Data: group1 values: 5.2 4.5 6.0 6.1 6.7 5.8 group2 values: 6.5 8.0 6.1 7.5 5.9 5.6 ... H0: mean1 = mean2 = mean3 = mean4 HA: at least two means different where I want to evaluate using a f test statistic? F = MSTr/MSE I'd like a table similar to one that
2012 Dec 23
2
Select maximum subset
Suppose i have matrix z id<-c(1,2,3,4,5) a <- c(4, 3, 2, NA, 1) b <- c(3, NA, 2, 7, 1) c <-c(3, NA, NA, 7, NA) z<- cbind(id,a, b,c) id a b c [1,] 1 4 3 3 [2,] 2 3 NA NA [3,] 3 2 2 NA [4,] 4 NA 7 7 [5,] 5 1 1 NA I want to select those columns for which I have the smallest number of NA In my example, these would be column1 and 2 since they give me 4 3 2 2
2004 Apr 19
1
using subscripts in a plot title with 2 lines
Hi, I'm making a plot in which the title takes up two lines. The title contains a subscript but when I look at the plot it does'nt seem tocome out properly. The code I'm using is: xtxt = expression(paste('Observed -log( ', IC[50], ' )')) ytxt = expression(paste('Predicted -log( ', IC[50], ' )')) mtxt = expression(paste('Plot of Observed
2006 Mar 11
2
Draw level lines on the surface of a bivariate function
Hello, Is it possible to draw level lines on the surface of a bivariate function? In the following example, to draw surface and levels lines for a multivariate normal law, I use persp, trans3d, contourLines and lines, but if the lines are correctly drawn, some parts of them are, of course, visible even if they are drawn on a non visible "face". Any suggestion to avoid this problem
2011 Aug 16
4
a question about lm on t-test.
Hi all: I have a question about lm on t-test. data(sleep) I wanna perform t-test to test the difference between the 2 groups: I can use: t.test(extra~group) The t.test result shows that:t = -1.8608; mean1=0.75,mean2=2.33 But I still wanna use: summary(lm(extra~group)) Intercept=0.75,which is mean1,just the same as t.test. group2=1.58 means the difference of the 2 groups,so
2011 Dec 14
1
Hi
First PRoblem solved > read.csv("KT80.csv") X x 1 1 0.01331361 > I ommitt "" in calling the file name... 2011/12/14 Trying To learn again <tryingtolearnagain@gmail.com> > Hi all, > > I have 100 csv files always with this information (I Attach two example > excels) > > KT80.csv contains: > ,"x" >
2011 Oct 28
2
Faster process for creating a matrix based on matrix element comparison
I have matrix data data<-matrix(cbind(c(0,0,0),c(NA,0,1),c(1,1,1),c(0,1,1)),ncol=3) and I want to create a new matrix by checking each element of the data and put value 0 if i have NA and 1 otherwise. For this reason i made the function below pdata<-matrix(NA,ncol=ncol(data),nrow=nrow(data)) pdata<-sapply(1:nrow(data),function(i) sapply (1:ncol(data),function(j) if (is.na(data[i,j]))
2002 Jan 04
0
R CMD check, file permissions (PR#1239)
SunOS fluke 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-Enterprise R-1.4.0 Running from the command line R CMD check chlib results in the log file 00check.log: * using log directory `/home/woodstock/hoffmann/R/Sources/chlib.Rcheck' * checking for file `chlib/DESCRIPTION' ... OK * checking package directory ... OK * checking for sufficient/correct file permissions ... WARNING *
2006 Mar 10
3
Sweave scientific real display format (e.g. 5e-12)
Dear All, I couldn't figure and couldn't google out how to make construct a pair of \Sexpr s or a LaTeX macro that would include 5\cdot 10^{-12} into the LaTeX output istead of 5e-12 . Any ideas? Thank you G?bor
2009 Jan 27
1
Problem with RMA using limma, oligo and pdInfoBuilder packages
Hi, I am a Ph.D. student from Québec, Canada. I’m a beginner with R and Bioconductor. Until now the only experience I have is in analyzing microarray data using affy and limma packages. Now I am trying to analyze Rat Gene 10 st arrays and I would like to run RMA analysis and Smyth moderated t test on those arrays. Since no cdf official package is available for those arrays, after reading many
2010 Oct 20
1
Generate variable with Bivariate Normal Distribution
Dear All I want to generate variable with Bivariate Normal Distribution by use mean1 = a, variance1 = b, mean2 = c, variance2 = d, rho = e. How I can do this. Many Thanks. IRD [[alternative HTML version deleted]]