similar to: How to provide list as an argument for the data.frame()

Displaying 20 results from an estimated 7000 matches similar to: "How to provide list as an argument for the data.frame()"

2010 Jan 20
2
R help for read.table()
I've a table containing two columns seperated by space, as shown below. S:C 2.011085038928 S:A 21.496800549900762 S:J 0.183181039138149 P:E 9.641984304606304 I'm reading this table inside a loop but unable to access the first column as file[i,1]. file <- read.table("data.txt",header=FALSE) for ( i in 1:nrow(file)) {  cat(file[i,1],":")  pvalue <-
2009 Jun 29
5
Help
Hi group, I found a module for adaptive kernel density estimation for Stata users, but unfortunetly I don't have access to Stata, can I find a similar approach using R? Thank u so much 4 ur time. [[alternative HTML version deleted]]
2011 Mar 09
1
Boxplot problem
Dear R-user, I'm facing problem to draw boxplot. I can draw my boxplot but the space option is not working for me. I've no clues where i'm doing wrong my data is as matrix as shown below:         [,1] [,2] [1,]   98  60 [2,]   96  70 [3,]   95  80 and i'm plotting as barplot(height=c(data[1,],data[2,],data[3,]),       beside=TRUE,           space=c(.1,1),          
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?
2013 Apr 16
4
Singular design matrix in rq
Quantreggers: I'm trying to run rq() on a dataset I posted at: https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing (it's a 1500kb csv file named "singular.csv") and am getting the following error: mydata <- read.csv("singular.csv") fit_spl <- rq(raw_data[,1] ~ bs(raw_data[,i],df=15),tau=1) > Error in rq.fit.br(x, y, tau = tau, ...) :
2011 May 17
1
simprof test using jaccard distance
Dear All, I would like to use the simprof function (clustsig package) but the available distances do not include Jaccard distance, which is the most appropriate for pres/abs community data. Here is the core of the function: > simprof function (data, num.expected = 1000, num.simulated = 999, method.cluster = "average", method.distance = "euclidean", method.transform =
2002 Dec 18
6
Can I build an array of regrssion model?
Hi, I am trying to use piecewise linear regression to approximate a nonlinear function. Actually, I don't know how many linear functions I need, therefore, I want build an array of regression models to automate the approximation job. Could you please give me any clue? Attached is ongoing code: rawData = scan("c:/zyang/mass/data/A01/1.PRN", what=list(numeric(),numeric())); len =
2012 Dec 10
1
Can somebody suggest how to achieve following data manipulation?
Dear all, Let say I have following data: RawData <- matrix(1:101, nr = 1); colnames(RawData) <- c("ASD", as.character(as.yearmon(seq(as.Date("2012-03-01"), length.out = 100, by = "1 month")))); rownames(RawData) <- "XYZ" CutOffDate <- as.Date("2012-09-01") NewDateSeries <- as.character(as.yearmon(seq(CutOffDate, to =
2008 Mar 23
1
mapply
In an earlier post, a person wanted to divide each of the rows of rawdata by the row vector sens so he did below but didn't like it and asked if there was a better solution. rawdata <- data.frame(rbind(c(1,2,2), c(4,5,6))) sens <- c(2,4,6) temp <- t(rawdata)/sens temp <- t(temp) print(temp) Gabor sent three other solutions and I understood 2 of them but not the
2005 Aug 04
2
Avoiding for loop
I understand that in R, for loops are not used as often as other languages, and am trying to learn how to avoid them. I am wondering if there is a more efficient way to write a certain piece of code, which right now I can only envision as a for loop. I have a data file that basically looks like: 1,55 1,23 2,12 ... that defines a matrix. Each row of the data file corresponds to a row of the
2006 Jul 12
4
Keep value lables with data frame manipulation
Dear R, I import data from spss into a R data.frame. On this rawdata I do some data processing (selection of observations, normalization, recoding of variables etc..). The result is stored in a new data.frame, however, in this new data.frame the value labels are lost. Example of what I do in code: # read raw data from spss rawdata <- read.spss("./data/T50937.SAV",
2012 Jan 20
2
rbind()
Hello there, Much thanks in advance for any help. I have a few questions: 1) Why do I keep getting the following error: File1 <- read.csv("../RawData/File1.csv",as.is=TRUE,row.names=1) Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file '../RawData/File1.csv': No such file or
2011 Sep 08
2
pie chart
Hi All, I have txt file like : $ cat data.txt US 10 UK 12 Ind 4 Germany 14 France 8 > rawdata <- read.table(file='data.txt',sep='\t' , header=FALSE) > rawdata V1 V2 1 US 10 2 UK 12 3 Ind 4 4 Germany 14 5 France 8 I want to draw pie chart for the above data. How to split rawdata into : con <-
2009 Aug 03
2
Scale set of 0 values returns NAN??
Hi, More questions in my ongoing quest to convert from RapidMiner to R. One thing has become VERY CLEAR: None of the issues I'm asking about here are addressed in RapidMiner. How it handles misisng values, scaling, etc. is hidden within the "black box". Using R is forcing me to take a much deeper look at my data and how my experiments are constructed. (That's a very
2009 Sep 28
1
help with lda function
I am having a problem understanding the lda package. I have a dataset here: [,1] [,2] [,3] [1,] 2.95 6.63 0 [2,] 2.53 7.79 0 [3,] 3.57 5.65 0 [4,] 3.16 5.47 0 [5,] 2.58 4.46 1 [6,] 2.16 6.22 1 [7,] 3.27 3.52 1 If I do the following; "names(d)<-c("y","x1","x2") d$x1 = d$x1 * 100 d$x2 = d$x2 * 100 g<-lda( y ~ x1 + x2, data=d) v2
2012 Jun 28
1
Merging listed dataset into one
Hello, I'm wondering how I can merge two featuresets into one. My dataset is two sets of microarray data and it looks like followings: > rawData $v1 TilingFeatureSet (storageMode: lockedEnvironment) assayData: 2197815 features, 59 samples element names: channel1, channel2 protocolData rowNames: LT290677RU_D1_2011-02-16 LT286300LU_D1_2010-07-24 ... LT003990RU_D1_2010-11-04 (59
2009 Jun 16
1
adressing dataframes
Hi everyone, I experience some problems with adressing of data.frames when I retrieve some information for geographical position (ypos, xpos) ot of a MySQL Database and want to perform some simple statistics. The problem is adressing the dataframes with a construct like rawdata[c(type)] vs. rawdata$TEMPMIN to retrieve the numerical information and not a string (I want to store the numerical
2008 Mar 22
2
More elegant multiplication or division of a data frame with a vector
Hello, I am importing some raw voltage multichannel measurements into an R data frame. I need to scale each column with the respective sensitivity for that channel. I figured how to do it, but I am curious if there isn't a more elegant way. Now I start with something like this: rawdata <- data.frame(rbind(c(1,2,3), c(4,5,6))) sens <- c(2,4,6) and I do this: data <-
2009 Sep 20
1
Return a list from a .Call but segfaults
Hello, I call a function via .Call passing to it a raw vector(D) and an integer(I) The vector is a series K1,KData1, V1,VData1, K2, KData2, ... where the integer K1 is the length of Data1 and similarly for Ki (wrt Datai)(similarly for V*) There 2*I such pairs( (Ki,KDatai), (Vi,VDatai)) The numbers Ki(and Vi) are written in network order. I am returning a list of I elements each element a
2008 May 26
1
To draw observation [m, n] from 20 data frames named frame1, ... , frame20
Hi all, I have 20 data frames, named frame1, ... , frame20. Each data frame has the dimension 20x5. I need to build a function that calls out the observation in Row 1, Col 2 from all 20 data frames and places it in a vector of length 20. I have tried the following code: vect <- rep(0,20) for(i in 1:20){ vect[i] <- paste("frame",i,"[1,2]",sep="") } The