similar to: Expand dataframe according to limits defined per row

Displaying 20 results from an estimated 10000 matches similar to: "Expand dataframe according to limits defined per row"

2011 Oct 05
1
Subsetting question
Hi all, Suppose I have data1 A B 1 a 1 b 2 c 2 d and data2 D E F x y 1 w z 2 and I want data2 D E F G x y 1 a,b w z 3 c,d I am trying data2$G=list(data1$B[data1$A==data2$F,]) How do I correct this approach? -- View this message in context: http://r.789695.n4.nabble.com/Subsetting-question-tp3876252p3876252.html Sent from the R help mailing list archive at Nabble.com.
2011 Oct 04
2
Create combinations of rows
I don't quite know how to word what I want, but if I have (1, 2, 3); (a, b, c); (x, y) I want: 1 a x 1 b x 1 c x 1 a y 1 b y 1 c y 2 a ... and so forth What is the appropriate command? Best, Don -- View this message in context: http://r.789695.n4.nabble.com/Create-combinations-of-rows-tp3872641p3872641.html Sent from the R help mailing list archive at Nabble.com.
2009 Feb 10
0
Dataframes: conditional calculations per row [SOLVED].
> Thank you very much Jorge, Phil and David: I was finally able to > perform the operations I needed. I changed the function in order to > adapt it to the simplest form like the following: > ali <- function(Abase) { > alitemp <- ((Abase/llmcc$Clase)*PClase)+(((1/llmcc > $Categoria)*Abase)*PCategoria)+((Abase*llmcc$Phi)*PPhi)+((Abase*llmcc > $Rf)*PRf) >
2005 May 13
1
manipulating dataframe according to the values of some columns
hi netters, I'm a newbie to R and there are some very simple problems puzzeled me for two days. I've a dataframe here with several columns different in modes. Two of the columns are special for me: column 1 has the mode "factor" and column 2 has the mode "numeric vectors". The values for column 1 are either "T" or "F". I wanna do two things:
2010 Mar 18
2
Reshape dataframe according to ordered variables
Dear all, I am still a R apprentice... Apologies for the basic question. I am trying to reshape a dataframe based on the order of two variables (a character variable and a numerical variable). To simplify it, consider the following dataframe > df<-data.frame(id=c("b","b","a","a","a"),ord=c(2,1,1,3,2)) id ord 1 b 2 2 b 1 3 a 1 4
2011 Nov 16
1
Replacing values in matrix/dataframe according to changing criteria
Hi there, I am doing some network analysis working with k-cliques and over time I want to see what nodes are members of what cliques and how big these cliques are. I have managed to produce a matrix which shows which k-cliques each node is part of over the 100 time periods (slow though) but I cannot seem to calculate the size of each k-clique which is actually just a count. Basically I have a
2009 Jul 31
1
Fill dataframe from a table according to a criteria
Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below Prob of States Changes State1 State2 State3 State4 A Pa1 Pa2 Pa3 Pa4 B Pb1 Pb2 Pb3 Pb4 C Pc1 Pc2 Pc3 Pc4 D Pd1 Pd2 Pd3 Pd4 and I have a dataframe called
2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all, I have a .csv file like below. Tool,Step_Number,Data1,Data2... etc up to 100 columns. A,1,0,1 A,2,3,1 A,3,2,1 . . B,1,3,2 B,2,1,2 B,3,3,2 . . ...... so on upto 50 rows where the column "*Tool*" has distinct steps in second column "*Step_Number*",but both have same entries in Step_Number column. I want the output like below.
2012 Dec 17
4
Splitting up of a dataframe according to the type of variables
Dear R users, I have a dataframe which consists of variables of type numeric and factor. What is the easiest way to split up the dataframe to two dataframe which contain all variables of the type numeric resp. factors? Thank you very much for your efforts in advance! Best, Martin
2007 Nov 30
1
dataframe does not expand as.Dates objects (PR#10481)
Full_Name: Adrian Dragulescu Version: 2.6.0 OS: Windows Submission from: (NULL) (216.99.178.65) > data.frame(x=1:10, y="A") # expands fine x y 1 1 A 2 2 A 3 3 A 4 4 A 5 5 A 6 6 A 7 7 A 8 8 A 9 9 A 10 10 A > > data.frame(x=1:10, z=as.Date("2007-01-01")) # get an error Error in data.frame(x = 1:10, z = as.Date("2007-01-01")) :
2009 Feb 09
2
Dataframes: conditional calculations per row .
Dear Sirs: I've been working with several variables in a dataframe that serve as part of a calculation that I need to perform in a different way depending on its value. Let me explain: The main dataframe is called llmcc llmcc : 'data.frame': 283 obs. of 11 variables: $ Area : num 308.8 105.6 51.4 51.4 52.9 ... $ mFondo : num 30.1 10 10.2 10.2 40.4 ... $ mFachada :
2013 Apr 24
2
Sum up column values according to row id
Dear All, here a problem I think many of you can solve in few minutes. I have a dataframe which contains values of plot id, diameters, heigths and basal area of trees, thus columns names are: id | dbh | h | g head(ipso, n=10) id dbh h g 1 FPE0164 36 13.62 0.10178760 2 FPE0164 31 12.70 0.07547676 21 FPE1127 57 18.85 0.25517586 13 FPE1127 39 15.54 0.11945906 12 FPE1127
2012 Dec 11
5
Renaming column names according to another dataframe
Hi, I've got a dataframe having a code as column name. Addtionally I have another dataframe with a two columns (and lots of rows), the first containing the code and the second some Text (real name). Now I'd like to use the information (pairs of code and name) of the second dataframe to rename all the columnnames in the first dataframe. How is it possible to achieve that? Here a small
2017 Jun 01
0
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
I think you should take this conversation private or seek local statistical expertise. This is about strategies for analysis, not about programming in R. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, May 31, 2017 at
2012 Jul 18
2
duplicate data between two data frames according to row names
Hi everybody. I'll first explain my problem and what I'm trying to do. Admit this example: I'm working on 5 different weather stations. I have first in one file 3 of these 5 weather stations, containing their data. Here's an example of this file: DF1 <- data.frame(station=c("ST001","ST004","ST005"),data=c(5,2,8)) And my two other stations in
2018 Apr 21
2
Check if row of dataframe is superset of any row in another dataframe.
Hi, I am looking for a way in which I can check if rows in 1 dataframe are present in another data frame in a unique way. A row in dataframe should be super set of any row in another dataframe. I can write a for loop for it, however, that will be inefficient. So, I am looking for an efficient way to do this in R. I have explained it with an example below: I want to check if a row in dataframe
2011 Oct 05
3
do calculations as defined by a string / expand mathematical statements in R
Dear R-group, is there a way to perform calculations that are defined in a string format? for example I have different variables: x1 <- 3 x2 <- 1 x4 <- 1 and a string-variable: do <- 'x1 + x2 + x3' Is there any way to perform what the variable 'do'-describes (just like the formula-element but more elemental)? Perhaps my idea to solve my problem is a little
2009 Aug 04
1
Build a dataframe row by row?
Hi, Time for another of my "newbie" questions. Is it possible to build up a data.frame "row by row" as I go I'm going to be running a bunch of experiments (many in a loop) to test different things. I'm using AUC as my main performance measure. My thought was to add a row to a data.frame for each iteration and then have a nice summary report at the end. I found
2010 Feb 05
1
remove a row from a dataframe, row names disappear
I find this odd because it doesn't appear to happen in larger datasets. I have the following data set ENV with the first column set as row.names: > ENV TPlog 001S29H 0.601 002S42H 0.602 003S43S 0.779 004S43S 0.702 005S51H 0.978 006S52P 2.718 If I apply > ENV <- ENV[-1,] # remove first row of data (right?) ...ENV comes back as: [1] 0.602 0.779 0.702 0.978 2.718 So I
2010 Feb 05
0
remove a row from a dataframe, row names disappear - solution
Thank you Sarah.I'm glad it was a quick fix: On Fri, Feb 5, 2010 at 8:50 AM, Sarah Goslee <> wrote: > You're not only removing a row of data, you are invoking the default > behavior of subset, which is to collapse the subsetted result to the > smallest possible type, which in this case is a vector. Vectors have > no rows, and thus no row names. > > You need the