Displaying 20 results from an estimated 20000 matches similar to: "extract required data from already read data"
2010 May 01
2
Average Login based on date
Hi All,
I have the data like this :
>sample <- read.csv(file="sample.csv",sep=",",header=TRUE)
> sample
stdate Domain sex age Login
1 01/11/09 xxx FeMale 25 2
2 01/11/09 xxx FeMale 35 4
3 01/11/09 xxx Male 18 30
4 01/11/09 xxx Male 31 3
5 02/11/09 xxx Male 32 11
6 02/11/09 xxx Male 31 1
7 02/11/09
2010 Jun 10
1
Re :help to aggregate data
Dear All,
I have the data some thing like this, I am showing here three days data
only:
> dummy.data <- read.table(file='dummy.txt',sep='', header=TRUE)
> dummy.data
StDate Domaindesc Logins
1 05/01/10 xxx 10
2 05/01/10 xxx 45
3 05/01/10 xxx 2
4 05/01/10 yyy 45
5 05/01/10 yyy 20
6 05/01/10 yyy
2008 Feb 12
3
help with bwplot
Dear list,
I have following data set, which I want to plot the "Scale" variable on the
x-axis and "Mean"´on the y-axis for each Ageclass and for each sex. The Mean
value of each Ageclass for each sex would be connected by a line. Totally,
there should be 6 lines, from which three present the Mean values of each
Ageclass for respective sex. Are there any easy ways to do
2005 Dec 24
2
grouping data
Hello R-users/experts,
I am new to R-
I have a simple question:
Let say I have a data set as follows
temp:[file attached]
the data structure is a follows:
sex age
female 28
female 53
female 53
female 36
male 42
male 29
male 43
male 36
male 41
Here we are grouping all male value into male and all female value in to
female
2010 Sep 10
3
(no subject)
Hello,
I'm trying to do bar plot where 'sex' will be the category axis and
'occupation' will represent the bars and the clusters will represent
the mean 'income'.
sex occupation income
1 female j 12
2 male b 34
3 male j 22
4 female j 54
5 male b 33
6
2005 Jun 25
1
Confidence interval bars on Lattice barchart with groups
I am trying to add confidence (error) bars to lattice barcharts (and
dotplots, and xyplots). I found this helpful message from Deepayan
Sarkar and based teh code below on it:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/50299.html
However, I can't get it to work with groups, as illustrated. I am sure I
am missing something elementary, but I am unsure what.
Using R 2.1.1 on various
2006 Dec 12
1
strings as factors
Hi,
To be able to match cases with a benchmark I need to have a data.frame with
a character id variable. however, I am surprised why this seems to be so
hard. In fact I was unable to succeed. Here is what I tried:
>test1 <-expand.grid(ID = 1:2, sex = c("male","female"))
>is(test1[,2])
[1] "factor" "oldClass"
>test2 <-expand.grid(ID =
2011 Feb 10
1
about prediction with a factor
Hi,
I don't know how to make prediction with a factor in the linear model.
Say
yd=c(1,2,3,4,5)
> sl=c(2,3,4,5,6)
> sex=c("male","male","female","female","male")
> sex=factor(sex)
> m=lm(sl~yd+sex+sex:yd)
How to make a prediction with new data like yd=c(4,5,6,7,8) for male and
female separately ?
Thank you very
2011 Feb 09
3
Need help merging two dataframes
Hi R users,
I am trying to extract some attributes (age, sex, area) from dataframe "AB"
that has 101,269 observations of 28 variables to dataframe "t2" that has 47
observations of 6 variables. They share a column called "id", which is a
factor with 47 levels. I want to end up with a dataframe that has 47
observations of 9 variables (the original 6 variables of t2,
2005 Nov 12
1
how to make automatically each level from data.frame to vector
Dear R-helpers,
Suppose I have dataset like this below:
data(HairEyeColor)
dfHEC <- as.data.frame(as.table(HairEyeColor))
my.dfHEC <- data.frame(Hair=rep(dfHEC$Hair,dfHEC$Freq),
Eye=rep(dfHEC$Eye,dfHEC$Freq),
Sex=rep(dfHEC$Sex,dfHEC$Freq))
my.dfHEC
my.dfHEC$Hair
my.dfHEC$Eye
my.dfHEC$Sex
and I know all levels for Hair, Eye and Sex.
In my case, I
2010 Oct 29
2
wilcox.test; data type conversion?
I'm working on a quick tutorial for my students, and was planning on
using Mann-Whitney U as one of the tests.
I have the following (fake) data
grade <- c("MVG", "VG", "VG", "G", "MVG", "G", "VG", "G", "VG")
sex <- c( "male", "male", "female", "male",
2010 Jul 31
3
I have a problem
dear£º
in the example£¨nomogram£©£¬I don't understand the meanings of the program which have been marked by red line.And how to compile the program(L <- .4*(sex=='male') + .045*(age-50) +
(log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))).
n <- 1000 # define sample size
set.seed(17) # so can reproduce the results
age <- rnorm(n, 50, 10)
2010 Mar 26
4
Creating a vector of categories
Hi,
I have a column in a data frame looking something like:
$sex $language $count
male english 0
male english 0
female english 32
male spanish 154
female english 11
female norweigan 7
and so on.
What I want to do is to order these in to categories, for instance one
category where count>=0 & count<10 and so on..
I want my data to turn out looking something like:
male
2011 Feb 18
3
How to change dataframe to tables
The data is in the attachment.
What I wanna get is:
, , Sex = Male
Eye
Hair Brown Blue Hazel Green
Black 32 11 10 3
Brown 53 50 25 15
Red 10 10 7 7
Blond 3 30 5 8
, , Sex = Female
Eye
Hair Brown Blue Hazel Green
Black 36 9 5 2
Brown 66 34 29 14
Red 16 7 7 7
Blond 4
2007 Dec 20
1
custom subset method / handling columns selection as logic in '...' parameter
Dear R-helpers & bioconductor
Sorry for cross-posting, this concerns R-programming stuff applied on
Bioconductor context.
Also sorry for this long message, I try to be complete in my request.
I am trying to write a subset method for a specific class (ExpressionSet
from Bioconductor) allowing selection more flexible than "[" method .
The schema I am thinking for is the following:
2004 Jun 22
1
Grouped AND stacked bar charts possible in R?
Good day all,
My statisticians want an R procedure that will produce grouped stacked
barplots. Barplot will
stack or group, but not both. The ftable function can produce a table
of the exact form they want, but the barplot doesn't show all the
divisions we want.
For an example, here's the sample from the help file for "ftable:"
data(Titanic)
ftable(Titanic, row.vars = 1:3)
2011 Jul 09
1
Eliminate level information
Hi, I hope this formatting is correct as it is my first time.
I am trying to do comparisons of values in a data frame that has some factor
variables.
One instance is
> train$sex[2]
[1] Male
Levels: Female Male
So the value is Male but a comparison like "Male" == train$sex[2]
will always return FALSE because of the level information included.
Another problem this creates is
2010 Apr 27
1
Randomization for block random clinical trials
Hi,
I’m new to R (just installed today) and I’m trying to figure out how to do
stratified randomisation using it. My google search expedition has lead me
to believe that blockrand package will most probably be the answer to it.
I’ve played around with blockrand for awhile and tried the sample code:
library(blockrand)
##stratified by sex
male <- blockrand(n=100,
2007 Aug 02
1
Xyplot - adding model lines to plotted points
Hello,
I have written code to plot an xyplot as follows:
library(lattice)
xyplot(len~ageJan1|as.factor(cohort),groups=sex,as.table=T,strip=strip.c
ustom(bg='white',fg='white'),data=dat,
xlab="Age (January 1st)",ylab="Length (cm)",main="Linear models for male
and female cod, by cohort",type='p',
2012 Dec 03
1
Confidence bands with function survplot
Dear all,
I am trying to plot KM curves with confidence bands with function survplot under package rms.
However, the following codes do not seem to work. The KM curves are produced, but the confidence bands are not there.
Any insights? Thanks in advance.
library(rms)
########data generation############
n <- 1000
set.seed(731)
age <- 50 + 12*rnorm(n)
label(age) <- "Age"