similar to: Inf and NA

Displaying 20 results from an estimated 3000 matches similar to: "Inf and NA"

2009 May 15
2
Help with loops
Hi I am trying to create a loop which averages replicates in my data. The original data has many rows. and consists of 40 column zz[,2:41] plus row headings in zz[,1] I am trying to average each set of values (i.e. zz[1,2:3] averaged and placed in average_value[1,2] and so on. below is my script but it seems to be stuck in an endless loop Any suggestions?? for (i in 1:length(average_value[,1])) {
2009 May 15
1
Fw: Help with loops(corrected question)
--- On Fri, 15/5/09, Amit Patel <amitrhelp at yahoo.co.uk> wrote: > From: Amit Patel <amitrhelp at yahoo.co.uk> > Subject: Help with loops > To: r-help at r-project.org > Date: Friday, 15 May, 2009, 12:17 PM > Hi > I am trying to create a loop which averages replicates in > my data. > The original data has many rows. and consists of 40 column > zz[,2:41]
2013 May 11
1
How to repeat 2 functions in succession for 400 times? (microarray data)
Hi, May be this helps: ?set.seed(24) ?mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38)) ?dim(mydata4) #[1] 10 38 ?library(matrixStats) res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4); (rowMeans(permutation[,1:27])-rowMeans(permutation[,28:38]))/(rowSds(permutation[,1:27])+rowSds(permutation[,28:38]))} )) ?dim(res) #[1]? 10 400 A.K.
2012 Oct 12
1
Error in rowMeans function
Hello, I am trying to create parcels for a CFA model. I am trying to average 6 sets of 3 variables each into parcels. I don't understand why I am getting an error message as follows: Thanks for your help, Catherine atds1par <- rowMeans(semHW1dat1[, c("atds1", "atds2", "atds3")], na.rm=TRUE) atds2par <- rowMeans(semHW1dat1[, c("atds4",
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" >
2009 Apr 01
2
Plotting multiple ablines
I really want to do this: abline( a=tan(-kT*pi/180), b=kY-tan(-kT*pi/180)*kX ) where kX,kY and kT are vectors of equal length. But I can't do that with abline unless I use a loop, and I haven't figured out the least unelegant way of writing the loop yet. So is there a way to do this without a loop? Or if I am to resort to the loop, what's the best way of doing it considering that I
2011 Feb 10
2
Calculating rowMeans from different columns in each row?
Hello! I have a dataset like this: X1 X2 X3 X4 X5 X6 X7 X8 1 2 2 1 2 3 2 6 2 3 2 5 7 9 1 3 1 9 12 6 1 1 3 6 The columns X1-X6 contains ordinary numeric values. X7 contains the number of the first column that the rowMeans should be calculated from and X8 contains the last column
2011 Apr 05
1
Inconsistency between rowMeans documentation and reality?
Dear List, I'm not even sure this is an issue or not, but ?rowMeans has: Value: A numeric or complex array of suitable size, or a vector if the result is one-dimensional. The ?dimnames? (or ?names? for a vector result) are taken from the original array. If there are no values in a range to be summed over (after removing missing values with ?na.rm = TRUE?), that
2008 Jun 12
3
Problem with rowMeans()
Hi all, I have a matrix called 'data', which looks like: > data[1:4,1:4] Probe_ID Gene_Symbol M1601 M1602 1 A_23_P105862 13CDNA73 -1.6 0.16 2 A_23_P76435 15E1.2 0.18 0.59 3 A_24_P402115 15E1.2 1.63 -0.62 4 A_32_P227764 15E1.2 -0.76 -0.42 > dim(data) [1]
2007 Nov 25
2
rowMean, specify subset of columns within Dataframe?
I would like to calculate the mean of tree leader increment growth over 5 years (I1 through I5) where each tree is a row and each row has 5 columns. So far I have achieved this using rowMeans when all columns are numeric type and used in the calculation: Data1 <- data.frame(cbind(I1 = 3, I2 = c(0,3:1, 2:5,NA), I3 =c(1:4,NA,5:2),I4=2,I5=3)) Data1 Data1$mean_5 <- rowMeans(Data1, na.rm =T)
2011 Feb 27
2
replacing missing values with row average
Hello, I have some dataset, which i read it from external file using the (data <- read.csv("my file location")) and read as a dataframe > is(data) [1] "data.frame" "list" "oldClass" "vector" but i have also converted this into a matrix and tried to apply my code but didnt work. Anyways, suppose i have the following data.
2017 Apr 01
3
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
In R 3.3.3, I observe the following on Ubuntu 16.04 (when building from source as well as for the sudo apt r-base build): > x <- c(NA, NaN) > mean(x) [1] NA > mean(rev(x)) [1] NaN > rowMeans(matrix(x, nrow = 1, ncol = 2)) [1] NA > rowMeans(matrix(rev(x), nrow = 1, ncol = 2)) [1] NaN > .rowMeans(x, m = 1, n = 2) [1] NA > .rowMeans(rev(x), m = 1, n = 2) [1] NaN >
2005 Jul 19
3
extracting row means from a list
Hello: I'm reading in a series of text files (100 files that are each 2000 rows by 6 columns). I wish to combine the columns (6) of each file (100) and get the row mean. I'd like to end up with a data.frame of 2000 rows by 6 columns. foo <- list() for(i in 1:10){ # The real data are read in from a series of numbered text files foo[[i]] <- data.frame(x1 = rnorm(100), x2 =
2017 Feb 17
11
[Bug 2680] New: Regression in server-sig-algs offer in 7.4p1 (Deprecation of SHA1 is not being enforced)
https://bugzilla.mindrot.org/show_bug.cgi?id=2680 Bug ID: 2680 Summary: Regression in server-sig-algs offer in 7.4p1 (Deprecation of SHA1 is not being enforced) Product: Portable OpenSSH Version: 7.4p1 Hardware: Other OS: Linux Status: NEW Severity: enhancement Priority: P5
2012 May 06
2
Saving a variable
Hi all, I´m trying to use write function to save the output of a program (my constructed "H" matrix) randz<-matrix(rnorm(1000000),500,2000) H<-matrix(0,500,2000) H[1,]<-randz[1,] for (j in 1:2000){ for (i in 2:500){ if(i<251) H[i,j]<-0.6*H[i-1,j]+randz[i,j] else H[i,j]<-H[i-1,j]+randz[i,j] }} write(H, file = "datad.txt",2000) If I ommit the 2000 on
2005 Mar 10
1
contrast matrix for aov
How do we specify a contrast interaction matrix for an ANOVA model? We have a two-factor, repeated measures design, with Cue Direction (2) x Brain Hemisphere(2) Each of these has 2 levels, 'left' and 'right', so it's a simple 2x2 design matrix. We have 8 subjects in each cell (a balanced design) and we want to specify the interaction contrast so that: CueLeft>CueRght
2008 Mar 05
1
Question on "assign(paste.."
Hello, I'm having trouble in using "assign(paste ..." command . I could create several dataframes following trinomial distribution using it but it could not be used to check their row means of the created dataframe. For example, the following works: probTrt=matrix(0,4,3); probTrt; #malf, death, normal probTrt[1,]=c(0.064,0.119,0.817);#for Trt 1 probTrt[2,]=c(0.053,0.125,0.823);#for
2010 Feb 16
2
HELP on Non-Linera Mixed-Effect model
Hi, I'm trying to fit nonlinear mixed effects model using nlme function but getting an error message. Here is what I have: fitted_model = nlme(scores~spline(b1,b2,b3,kt,time), fixed = list(b1~1, b2~1, b3~1, kt~1), random = b1+b2+b3~1, groups= ~id, data = sdat, start = c(b1=3.5,b2=2,b3=.60,kt=3.5),verbose=T) Error: Error in
2017 Apr 01
1
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
On Fri, Mar 31, 2017 at 10:14 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: > From ?NA > > Numerical computations using ?NA? will normally result in ?NA?: a > possible exception is where ?NaN? is also involved, in which case > either might result. > > and ?NaN > > Computations involving ?NaN? will return ?NaN? or perhaps ?NA?: >
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