Displaying 7 results from an estimated 7 matches for "subdf".
Did you mean:
subd
2012 Aug 11
1
using eval to handle column names in function calling scatterplot graph function
...function I'm trying to create to:
1. subset a data.frame based on function arguments (colname & parmname)
2. rename the PARMVALUE column in the data.frame based on function
argument (xvar)
3. generate charts
plotvar <- function(parentdf,colname, parmname,xvar,yvar ){
subdf <- parentdf[substr(colname,1,nchar(parmname)) == parmname,]
names(subdf) <- sub('PARMVALUE',xvar, names(subdf))
xvarcol <- paste("subdf","$",xvar,sep="")
yvarcol <- paste("subdf","$",yvar,sep="")
his...
2006 Feb 22
1
unused factor levels in reshape
....constant)) warning(gettextf("some constant variables (%s) are really varying", :
missing value where TRUE/FALSE needed
For example,
> df <- data.frame(i = factor(rep(1:5, each = 2)), t = factor(rep(1:2, 5)), x = rep(rbinom(5, 1, 0.5), each = 2), y = rpois(10, 10))
> subdf <- subset(df, i %in% 1:3)
defines a dataframe, and a subframe with some unused factor levels (i = 4, 5). Then
> reshape(df, v.names = "y", timevar = "t", idvar = "i", direction = "wide")
i x y.1 y.2
1 1 0 13 6
3 2 0 12 5
5 3 0 10 9
7 4 1...
2008 Jan 11
3
filtering data frame based on two columns
Hi,
I have a data frame df with column names a,b and c.
Now I want to get a subset of df that satified the condition a == 1 and b
== 2, how do I specify this.
For one condition like a == 1 I can use subdf = df[,df$a==1] to get the
right answer, but
subdf = df[,df$a==1 && df$b ==2] does not return the right answer.
Some quick tips please.
2018 Jun 01
4
Regroup and create new dataframe
Hello folks,
I have a big project to work on and the dataset is classified so I am just
going to use my own example so everyone can understand what I am targeting.
Let's take Target as an example: We consider three brands of tape: Target
brand, 3M and Avery. The original data frame has 4 columns: Year of Record,
Product_Name(which contains three brands of tape), Sales, and Region. I
want to
2011 Jun 07
1
extract data features from subsets
I have a large dataset similar to this:
ID time result
A 1 5
A 2 2
A 3 1
A 4 1
A 5 1
A 6 2
A 7 3
A 8 4
B 1 3
B 2 2
B 3 4
B 4 6
B 5 8
I need to extract a number of features for each individual in it (identified by "ID"). These are:
* The lowest result (the nadir)
* The time of the nadir - but if the nadir level is present at >1 time point, I need the minimum and maximum time of nadir
2012 Sep 28
3
Better way of Grouping?
Hello R users,
This is more of a convenience question that I hope others might find useful
if there is a better answer. I work with large datasets that requires
multiple parsing stages for different analysis. For example, compare group
3 vs. group 4. A more complicated comparison would be time B in group 3 of
group L with B in group 4 of group L. I normally subset each group with
the
2004 Jun 23
4
Automatic routine - NEW
Hi Again,
First of all thank you for all the responses to my previous query.
Your answers were very helpful and I did the job ;-). Now I hope you
can answer as quick the following (sorry I am invading you with
trivial questions):
Let?s use again the following data.frame example:
DF <- data.frame(x=rnorm(5), y=rnorm(5))
I want to obtain a new data.frame (or matrix) that contains only n