similar to: splitting into multiple dataframes and then create a loop to work

Displaying 20 results from an estimated 1000 matches similar to: "splitting into multiple dataframes and then create a loop to work"

2010 Nov 11
4
How to get a specific named element in a nested list
Hello, I have a nested named list structure, like the following: x <- list( list( list(df1,df2) list(df3, list(df4,df5)) list(df6,df7))) with df1...d7 as data frames. Every data frame is named. Is there a way to get a specific named element in x? so, for example, x[[c("df5")]] gives me the data frame 5? Thank you in advance! Best, Friedericksen
2007 Sep 27
2
create data frame(s) from a list with different numbers of rows
# Hello, # I have a list with 6 categories and with different numbers of rows. # I would like to change each of them into a unique data frame in order to match # values with other data frames and perform some calculations. # Or I could make each category or list element have the same number of rows and create one large data.frame. # below is a creation of a sample list # I apologize for the
2010 Jan 20
1
Reshaping data with xtabs giving me 'extra' data
Dear all, Lets say I have several data frames as follows: > set.seed(42) > dates <- as.Date(c("2010-01-19", "2010-01-20")) > times <- c("09:30:00", "11:30:00", "13:30:00", "15:30:00") > shows <- c("Red Dwarf", "Being Human", "Doctor Who") > > df1 <- data.frame(Date = dates[1],
2012 Jan 26
1
How to remove rows representing concurrent sessions from data.frame?
I have a dataset like this (dput for this below) which represents user computer sessions: username machine start end 1 user1 D5599.domain.com 2011-01-03 09:44:18 2011-01-03 09:47:27 2 user1 D5599.domain.com 2011-01-03 09:46:29 2011-01-03 10:09:16 3 user1 D5599.domain.com 2011-01-03 14:07:36 2011-01-03 14:56:17 4 user1 D5599.domain.com
2009 Oct 07
1
merging dataframes with an unequal number of variables
Hallo Everyone I have the kind of problem that one should never have because one must always plan well and communicate with your team. But now I haven't so here is my problem. I have data coming in on a daily basis from surveys in 10 towns. The questionnaire has 62 variables but some of the regions have used older versions of the questionnaire that have a few variables less. I want to combine
2011 Apr 04
2
reading from text file that have different rowlength and create a data frame
Hi R-experts I have many text files to read and combined them into one into R that are output from other programs. My textfile have unbalanced number of rows for example: ;this is example ; r help Var1 Var2 Var3 Var4 Var5 0 0.05 0.01 12 1 0.04 0.06 18 A 2 0.05 0.08 14 3 0.01 0.06
2009 Dec 09
2
Problem with if statement
I am trying to use the value of an ID variable in an if statement and not getting the results I expected. # ID values for two school districts > with(rf, tapply(DistrictID, DistrictName, min) ) Aberdeen School Dist. # 58 Buhl Joint School District 59340 53409 This creates DNAME as I expected ...
2004 Aug 17
5
Bug in colnames of data.frames?
Hi, I am using R 1.9.1 on on i686 PC with SuSE Linux 9.0. I have a data.frame, e.g.: > myData <- data.frame( var1 = c( 1:4 ), var2 = c (5:8 ) ) If I add a new column by > myData$var3 <- myData[ , "var1" ] + myData[ , "var2" ] everything is fine, but if I omit the commas: > myData$var4 <- myData[ "var1" ] + myData[ "var2" ] the name
2004 Mar 09
5
Adding data.frames together
I have a series of data frames that are identical structurally, i.e. - made with the same code, but I need to add them together so that they become one, longer, data frame, i.e. - each of the slot vectors are increased in length by the length of the added data frame vectors. So if I have df1 with a slot A so that length(df1$A) = 100 and I have df2 with a slot A so that length(df2$A)=200 then I
2010 Nov 08
2
Several lattice plots on one page
Dear all, I am trying (!!!) to generate pdfs that have 8 plots on one page: df = data.frame( day = c(1,2,3,4), var1 = c(1,2,3,4), var2 = c(100,200,300,4000), var3 = c(10,20,300,40000), var4 = c(100000,20000,30000,4000), var5 = c(10,20,30,40), var6 = c(0.001,0.002,0.003,0.004), var7 = c(123,223,123,412), var8 = c(213,123,234,435), all = as.factor(c(1,1,1,1)))
2017 Oct 10
1
About multiple panels with limited space in-between
Hi R users, I have a question about plotting. The following two datasets are an example. What I have in mind is like the attached figure, but just have two rows, top row is for DF1, bottom row is for DF2. The top and bottom rows, have x-axis as var1, var2, var3, etc, while the y-axis represents A. For each row, only the leftmost panel has y-axis ticks and label. For the two rows, only the bottom
2010 Dec 22
3
A question to get all possible combinations
Let say, I have a matrix with 8 rows and 6 columns:  >  df1  <- matrix(NA, 8, 4)  > df1       [,1] [,2] [,3] [,4]  [1,]   NA   NA   NA   NA  [2,]   NA   NA   NA   NA  [3,]   NA   NA   NA   NA  [4,]   NA   NA   NA   NA  [5,]   NA   NA   NA   NA  [6,]   NA   NA   NA   NA  [7,]   NA   NA   NA   NA  [8,]   NA   NA   NA   NA  Now I want to get **all possible** ways to fetch 6 cells at a
2012 Jan 10
4
Sum of a couple of variables of which a few have NA values
Dear everyone, I have looked all over the internet but I cannot find a way to solve my problem. In my data I want to sum a couple of variables. Some of these variables have NA values, and when I add them together, the result is NA dat <- data.frame( id = gl(5,1), var1 = rnorm(5, 10), var2 = rnorm(5, 7), var3 = rnorm(5, 6), var4 = rnorm(5, 3), var5 = rnorm(5, 8) ) dat[3,3] <- NA dat[4,5]
2007 Oct 15
2
Variable which has the maximum value of DF
Hi, Suppose I have a data.frame like this Lines <- "var1 var2 var3 var4 var5 var6 0 2 1 2 0 0 2 3 7 6 0 1 1.5 4 9 9 6 0 1.0 6 10 22 3 3 " DF <- read.table(textConnection(Lines), skip=1) names(DF) <- scan(textConnection(Lines), what = "", nlines = 1) How do I find the
2010 Jan 25
5
Data transformation
Dear all, I have a dataset that looks like this: x <- read.table(textConnection("col1 col2 3 1 2 2 4 7 8 6 5 10"), header=TRUE) I want to rewrite it as below: var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 1 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0
2010 Dec 03
2
Add columns of dataset
Dear all, I have a dataset that looks like id var1 var2 var4 var7 var8 1 0.0 0.1 0.3 0.9 0.0 2 0.4 0.6 0.0 0.0 0.2 3 0.0 0.0 0.0 0.8 0.7 Some columns are missed, for example, here the fourth (var3), sixth(var5) and seventh (var6) columns. I want to first determine which columns are missed in a huge dataset and then add the missed
2011 Jun 23
2
Merging multiple data sets
Hi, I am trying to merge data similar to the example data below > dat0 id var1 var2 var3 2 1 0 1 3 1 0 1 4 0 1 1 5 0 1 1 > dat1 id var4 var5 var6 2 1 0 1 3 1 0 1 6 0 1 1 7 0 1 1 > dat2 id
2005 Oct 20
1
Windows 2000 crash while using rbind (PR#8225)
Windows 2000 reports that "Rgui.exe has generated errors and will be = closed by Windows. You will need to restart the program." when using = rbind.=20 df1 <- data.frame(cbind(x=3D1, y=3D1:1000), fac=3Dsample(LETTERS[1:3], = 1000, repl=3DTRUE)) df2 <- data.frame(cbind(x=3D1, y=3D1:10), fac=3Dsample(LETTERS[4:6], = 10, repl=3DTRUE)) df3 <- data.frame(cbind(x=3D1,
2010 Jul 29
3
Fwd: duplicates
-- Eredeti üzenet -- Feladó: Dévaványai Agamemnón &lt;devavanyai@citromail.hu&gt;Címzett: r-hel@r-project.org, r-hel@r-project.orgElküldve: 2010. július 29. 16:29Tárgy : duplicates Sorry! I try it again Dear R Users! I have a dataframe with duplicatecases. Var1 duplicated by var2. var1 var2 var3 var4 var5 1 4 500 1 2 1 3 200 2 5 1
2006 Feb 21
6
How to sum values across multiple variables using a wildcard?
I have a dataframe called "data" with 5 records (in rows) each of which has been scored on each of many variables (in columns). Five of the variables are named var1, var2, var3, var4, var5 using headers. The other variables are named using other conventions. I can create a new variable called var6 with the value 15 for each record with this code: > var6=var1+var2+var3+var4+var5