similar to: adding columns to dataframes contained in a list

Displaying 20 results from an estimated 10000 matches similar to: "adding columns to dataframes contained in a list"

2013 Jan 29
2
converting XML document to table or dataframe
I am a relatively new user to R, and I am trying to learn more about converting data in an XML document into "2-dimensional format" such as a table or array. I might eventually wish to export this data into a relational database such as SQL, and/or to work with this data within the R package. My sample XML document is located at "
2011 May 11
2
Dotplot (package Hmisc) with groups: colours and symbols
Hello all, This question concerns the function Dotplot from the Hmisc package. My aim is to compare values between groups in each panel of the Dotplot, with the values of different groups clearly distinguishable by different symbols. All lines and symbols should be coloured in black. Before adding the panel function to the Dotplot, the groups behaved as desired and were marked by different
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
I'm writing a function and keep getting the following error message. myfunc <- function(lst) { lst <- list(roots = c("car insurance", "auto insurance"), roots2 = c("insurance"), prefix = c("cheap", "budget"), prefix2 = c("low cost"), suffix = c("quote", "quotes"), suffix2 = c("rate",
2011 May 25
3
Accessing elements of a list
I have a list that is made of lists of varying length. I wish to create a new vector that contains the last element of each list. So far I have used sapply to determine the length of each list, but I'm stymied at the part where I index the list to make a new vector containing only the last item of each list mylist =
2012 Jun 28
3
loop through and modify multiple data frames
Hi Newbie question: I have a set of data frames that I want to do the same calculations on each. I've found out that I can put them in a list and loop through the list to do the calculation, but not put the results back into each data.frame.. For example three data frames cats, dogs, birds where >cats name eats_kg 1 bob 3 2 garfield 4 3 chuck 6 and dogs and birds are similar but not
2013 Feb 26
2
merging or joining 2 dataframes: merge, rbind.fill, etc.?
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd (mydf). I want the 3rd dataframe to contain 1 row for each row in df1 & df2, and all the columns in both df1 & df2. The solution should "work" even if the 2 dataframes are identical, and even if the 2 dataframes do not have the same column names. The rbind.fill function seems to work. For
2011 Jul 25
1
predict() and heteroskedasticity-robust standard errors
Hello there, I have a linear regression model for which I estimated heteroskedasticity-robust (Huber-White) standard errors using the coeftest function in the lmtest-package. Now I would like to inspect the predicted values of the dependent variable for particular groups and include a confidence interval for this prediction. My question: is it possible to estimate confidence intervals for the
2011 Apr 01
3
programming: telling a function where to look for the entered variables
Hi there, Could someone help me with the following programming problem..? I have written a function that works for my intended purpose, but it is quite closely tied to a particular dataframe and the names of the variables in this dataframe. However, I'd like to use the same function for different dataframes and variables. My problem is that I'm not quite sure how to tell my function in
2008 Jan 18
1
Assigning into each of a list of dataframes
What is the right way to assign a new variable into each a of list of data frames? Here is my failed attempt: mylist <- list(df1 = data.frame(A = runif(5), B = runif(5)), df2 = data.frame(A = runif(5), B= runif(5))) lapply(mylist, function(x){x$Y <- x$A * x$B}) $df1 [1] 0.25589928 0.03446026 0.94992362 0.21388326 0.08668821 $df2 [1] 0.08771839 0.05643553 0.09036894
2009 Jan 21
3
merging several dataframes from a list
Hi there, I have a list of dataframes (generated by reading multiple files) and all dataframes are comparable in dimension and column names. They also have a common column, which, I'd like to use for merging. To give a simple example of what I have: df1 <- data.frame(c(LETTERS[1:5]), c(2,6,3,1,9)) names(df1) <- c("pos", "data") df3 <- df2 <- df1 df2$data
2018 Apr 15
0
Adding a new conditional column to a list of dataframes
> On Apr 15, 2018, at 4:08 AM, Allaisone 1 <Allaisone1 at hotmail.com> wrote: > > > Hi all .., > > > I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes. > > > When I extract one dataframe and apply my code it works very well as
2011 May 05
1
memory and bootstrapping
hello, the following questions will without doubt reveal some fundamental ignorance, but hopefully you can still help me out. I'd like to bootstrap a coefficient gained on the basis of the coefficients in a logistic regression model (the mean differences in the predicted probabilities between two groups, where each predict() operation uses as the newdata-argument a dataframe of equal size as
2018 Apr 15
4
Adding a new conditional column to a list of dataframes
Hi all .., I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes. When I extract one dataframe and apply my code it works very well as follows :- First suppose this is my first dataframe in the list > OneDF <- Mylist[[1]] > OneDF ID Pdate
2007 Jul 07
1
calculating p-values of columns in a dataframe
I have a dataframe ("mydf") that contains "differences of means". I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a "good" method to calculate/look-up the p-value for each column? mydf=data.frame(a=c(1,-22,3,-4),b=c(5,-6,-7,9)) mymean=mean(mydf) mysd=sd(mydf)
2003 May 31
5
parse on left hand side of R assignment
I keep finding myself in a situation where I want to calculate a variable name and then use it on the left hand side of an assignment. For example iteration <- 1 varName <- paste("run",iteration,sep="") myList$parse(text=varName) <- aColumn I want to take some existing variable "aColumn" and use the name "varName" name for it and put it into a
2007 Feb 04
3
Reference to dataframe and contents
This is probably easy for experienced users but I could not find a solution. I have several R scripts that process several columns of a dataframe (several dataframes and columns actually, but simplified for my question). References such as: myDF$myCol are all over. I like to automate this for other dataframes and columns by defining a reference only once in the beginning of the script. One
2018 May 23
2
Pasar palabras de una lista a una variable del dataframe
Muchas gracias Carlos, Me da error al hacerlo. Mi variable donde quiero que localice las palabras de la lista tiene más de una palabra, no se si puede ser por eso. Gracias El Mar, 22 de Mayo de 2018, 20:15, Carlos Ortega escribió: > Hola, > > Aquí tienes un ejemplo (reproducible)... > > #----------------------- >> # Generar nombres de mujer >> library(randNames)
2011 Apr 29
3
Re-downloading mails after migrate server
Hi all... again. I have uploaded the new server to dovecot 2.0.12, and still having the same issue. I have even tried changing the hostname, and still the same. I have checked the site http://wiki2.dovecot.org/Migration at the "POP3 migration" section, and I can't see the problem. The UIDLs between hosts are still the same, and I am lost at what is making me download the mails
2017 Nov 22
1
assign NA to rows by test on multiple columns of a data frame
...well, I don't think this is exactly the expected result (see my post) to be noted that the columns affected should be "A" and "B" thanks for the help max ----- Messaggio originale ----- Da: "Rui Barradas" <ruipbarradas at sapo.pt> A: "Massimo Bressan" <massimo.bressan at arpa.veneto.it>, "r-help" <r-help at
2011 Aug 16
1
Utilizing column names to multiply over all columns
## Hello there, ## I have an issue where I need to use the value of column names to multiply with the individual values in a column and I have many columns to do this over. I have data like this where the column names are numbers: mydf <- data.frame(`2.72`=runif(20, 0, 125), `3.2`=runif(20, 50, 75), `3.78`=runif(20, 0, 100), yy=