similar to: Re : A. Mani : Avoiding Loops

Displaying 20 results from an estimated 2000 matches similar to: "Re : A. Mani : Avoiding Loops"

2005 Aug 22
0
R-help Digest, Vol 30, Issue 22
Re: A. Mani : Avoiding loops (Petr Pikal) > Message: 9 > Date: Mon, 22 Aug 2005 06:40:45 +0200 > From: "Petr Pikal" <petr.pikal at precheza.cz> > Subject: Re: [R] A. Mani : Avoiding loops > To: "A. Mani" <a_mani_sc_gs at vsnl.net>, r-help > <r-help at stat.math.ethz.ch> > > On 20 Aug 2005 at 3:26, A. Mani wrote: > > > On
2005 Aug 18
2
A. Mani : Avoiding loops
Hello, I want to avoid loops in the following situation. There is a 5-col dataframe with col headers alone. two of the columns are non-numeric. The problem is to calculate statistics(scores) for each element of one column. The functions depend on matching in the other non-numeric column. A B C E F 1 2 X Y 1 2 3 G L 1 3 1 G L 5 and so on ...30000+ entries. I need scores
2008 Mar 16
2
How to loop through all the columns in dataframe
Hi: Can anyone advice me on how to loop and perform a calculation through all the columns. here's my data xd<- c(2.2024,2.4216,1.4672,1.4817,1.4957,1.4431,1.5676) pd<- c(0.017046,0.018504,0.012157,0.012253,0.012348,0.011997,0.012825) td<- c(160524,163565,143973,111956,89677,95269,81558) mydf<-data.frame(xd,pd,td) trans<-t(mydf) trans I have these values that I need to
2010 Mar 22
1
help needed with boxplot
I am new to R, can anyone help with boxplot for a dataset like: file1 col1 col2 col3 col4 col5 050350005 101 56.625 48.318 RED 051010002 106 50.625 46.990 GREEN 051190007 25 65.875 74.545 BLUE 051191002 246 52.875 57.070 RED 220050004 55 70 80.274 BLUE 220150008 75 67.750 62.749 RED 220170001 77 65.750 54.307 GREEN file2 col1 col2 col3 col4 col5 050350005 101 56.625 57 RED 051010002 106 50.625 77
2011 May 31
0
filling in a dataframe with another dataframe
Hello All, I have two dataframes and I wish to insert the values of one dataframe into another (let's call them DF1 and DF2). DF1 looks like this: col1.....col2 a...........1 b...........2 c...........3 d...........4 e...........5 f............6 g...........7 where col1 (which is just the first column of the dataframe) is a list of characters and col2 is the numeric value associated with
2008 Apr 09
1
Replace values according to conditions
Greetings R-users, I have the following data called mydata in a data.frame Col1 Col2 Col3 Col4 Col5 1 2 4 6 7 8 8 7 3 5 4 4 5 6 7 I want to replace the data according to the following conditions Condition 1 if data <= 3, replace with -1 Condition 2 if data >=6, replace with 1 Condition 3 if data = 4 or data =5, replace with 0
2010 Oct 21
2
Adding rows to column
I'm new to R. I'm extracting important columns from single table using following code: File2<-"file.txt" table2<- read.delim(File2, skip=19, sep=";", header=F, na.strings=NA, fill=T) #extracting column 7 where rows match "ID" col1<- table2[grep("ID", table2[,1]),7] #similarly extracting column 9,11,13,15 col2<-
2006 Dec 14
5
Better way to change the name of a column in a dataframe?
Hello R users -- If I have a dataframe such as the following, named "frame" with the columns intended to be named col1 through col6, > frame col1 col2 cmlo3 col4 col5 col6 [1,] 3 10 2 6 5 7 [2,] 6 8 4 10 7 1 [3,] 7 5 1 3 1 8 [4,] 10 6 5 4 9 2 and I want to correct or otherwise change the
2011 Aug 25
2
replicate lines of data frame
Greetings! I am just now learning to use R for my dissertation project. I need to manipulate a lot of text and numeric data. I created a data frame that has 7 columns and 127 unique rows. Now I need to replicate each line 6 times and then later change values in the first 2 columns. I am trying to figure out how to accomplish this. I think that I need to use rep(my.df, each=6) but it does
2016 Dec 27
0
colnames for data.frame could be greatly improved
Hi there, Any update on this? Should I create bugzilla ticket and submit patch? Regards Jan Gorecki On 20 December 2016 at 01:27, Jan Gorecki <J.Gorecki at wit.edu.pl> wrote: > Hello, > > colnames seems to be not optimized well for data.frame. It escapes > processing for data.frame in > > if (is.data.frame(x) && do.NULL) > return(names(x)) > > but
2009 Nov 05
1
Set colors in a PCA plot based on a gradient vector
Hi all, I'm making a PCA plot with eight variables (columns taken from a larger data frame "fieldTrial0809[idx,c(39:46)]"). I then want the symbols in the plot to be colored as a gradient from red to blue, depending on the value of another column in "fieldTrial0809[idx, c(48)]" containg temperatures from -12.1 to -5.4. I don't want to use the heat.colors(n)
2011 Jan 24
2
how to slice a zoo object
Hi Would anyone have any pointers on how to slice up a large zoo table. I have the following structure: - > str(ZOO_OBJ) ?zoo [1:632, 1:83] 30.4 30.4 30.4 30.4 30.3 ... ?- attr(*, "dimnames")=List of 2 ??..$ : NULL ??..$ : chr [1:83] "COL1" "COL2" "COL3" "COL4" ... ?- attr(*, "index")= POSIXct[1:632], format: "2009-05-01
2016 Dec 20
2
colnames for data.frame could be greatly improved
Hello, colnames seems to be not optimized well for data.frame. It escapes processing for data.frame in if (is.data.frame(x) && do.NULL) return(names(x)) but only when do.NULL true. This makes huge difference when do.NULL false. Minimal edit to `colnames`: if (is.data.frame(x)) { nm <- names(x) if (do.NULL || !is.null(nm)) return(nm) else
2012 Oct 18
4
speeding read.table
R 2.15.1 OS X Colleagues, I am reading a 1 GB file into R using read.table. The file consists of 100 tables, each of which is headed by two lines of characters. The first of these lines is: TABLE NO. 1 The second is a list of column headers. For example: TABLE NO. 1 COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10
2006 May 15
1
what's wrong with my "gls"? it does not allocate memory... even for the simplest AR1 model...
> myfit1 <- gls(col1 ~ col2+col3+col4+col5+col6-1, data=data2, corr=corAR1( 0.3202), method='ML') Error: cannot allocate vector of size 199712 Kb if I get rid of the "corr=corAR1(0.3202)" option, it works okay... can anybody help me? thanks a lot! [[alternative HTML version deleted]]
2012 Feb 15
1
neuralnet problem
Hello List ! I'm a bright new R user, and I encounter a problem when trying to use the neuralnet package. I have a training set with 8 inputs, and there are 3 outputs (I need 3 distinct neurones as output). Although I read the examples, and the package article, I don't know how to tell R there are 3 outputs (3 outputs neurones). Here is my actual code : # All = input data All <-
2018 May 08
2
Dinamic variables in loop
Hello, I am a newbie in R and I have a problem. I want this line: newMyData <-MyData[!(is.na(col1)) | !(is.na(col2)) | !(is.na(col3)) | !( is.na(col4)) | !(is.na(col5)),] write in for loop. The number of col[number] may be different from 3 to 8 Is there any ideas? Thank you Laura [[alternative HTML version deleted]]
2004 May 12
2
How to know the row number of raw matrix after resampling?
> DATA [,1] [1,] -2.0314185 [2,] -0.3594015 [3,] -1.3225832 [4,] 1.5050892 [5,] -0.4535558 [6,] 3.6335036 [7,] 5.1965750 [8,] 4.2923129 [9,] 6.0913187 [10,] 4.9131070 > RESA [,1] [,2] [,3] [,4] [,5] [1,] -2.0314185 1.5050892 -1.3225832 -1.3225832 -2.0314185 [2,] -0.3594015 -0.3594015 4.2923129 -0.3594015
2018 May 08
0
Dinamic variables in loop
Dear Laura, It looks like you want to remove all rows for which each column is NA. You can to that with the code below. na.matrix <- is.na(MyData) all.na.row <- apply(na.matrix, 1, all) MyData[!all.na.row, ] Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
2005 Jun 28
0
R-help Digest, Vol 28, Issue 28
On Tuesday 28 June 2005 15:30, r-help-request at stat.math.ethz.ch wrote: Re : 37. Re: A. Mani : colours in Silhouette (Mulholland, Tom) > > Message: 37 > Date: Tue, 28 Jun 2005 09:08:24 +0800 > From: "Mulholland, Tom" <Tom.Mulholland at dpi.wa.gov.au> > Subject: Re: [R] A. Mani : colours in Silhouette > To: <a_mani_sc_gs at vsnl.net>, <r-help at