Displaying 20 results from an estimated 20000 matches similar to: "Is it possible to only read a subset by read.table ?"
2006 Jun 27
1
Very slow read.table on Linux, compared to Win2000
Dear all,
I read.table a 17MB tabulator separated table with 483 variables(mostly numeric) and 15000
observations into R. This takes a few seconds with R 2.3.1 on windows 2000, but it takes
several minutes on my Linux machine. The linux machine is Ubuntu 6.06, 256 MR RAM,
Athlon 1600 processor. The windows hardware is better (Pentium 4, 512 RAM), but it
shouldn't make such a difference.
2010 May 07
2
extract required data from already read data
Hi all,
I have 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
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:
2009 Jan 22
2
Frequency and summary statistics table with different variables and categories
Hello helpers,
This is probably quite simple, but I'm stuck.
I want to create a summary statistics table with frequencies and summary
statistics for a large number of variables. The problem here is that (1)
there are two different classes of categories (sex, type of substance abuse
and type of treatent) which overlap, (2) the data for different variables
should be presented in different
2010 May 02
3
percent by subset
Suppose my data looks like this:
Obs, Male, Female, Height
1, T, F, 66
2, F, T, 64
3, T, F, 59
4, T, F, 55
5, F, T, 62
6, T, F, 67
7, T, F, 58
8,
2005 Mar 22
1
List of tables rather than an extra dimension in the table or (l)apply(xtabs)
I'm not sure how to best explain what I am after but here goes. I have a data frame with 2 geographical factors. One is the major region the other is the component regions.
I am trying to process all the regions at the same time without using "for". So I need (think, I do) a list of matrices each structured according to the number of subregions within each region.
So is there a
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
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)
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 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 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",
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on
for a drop down menu. How can this be done?
My table looks like
Table with constants
------------------------
id | key | value | type
------------------------
1 | M | Male | sex
....
I know it can be done like this
<% select ''object'', ''method'', Constants.find(:all, :select =>
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
2004 Jun 16
2
subset and lme
I'm puzzled by the following problem, which appears when
attempting to run an analysis on part of a dataset:
If I try:
csubset <- dat$Diagnosis==0
cont <- lme(fixed=cform,
random = ~1|StudyName,
data=dat,subset=csubset,na.action=na.omit)
Then I get:
Error in eval(expr, envir, enclos) : Object "csubset" not found
But if I do
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)
2012 Sep 05
2
Recoding categorical gender variable into numeric factors
I currently have a data set in which gender is inputed as "Male" and "Female"
, and I'm trying to convert this into "1" and "0".
I found a website which reccomended using two commands:
data$scode[data$sex=="M"] <- "1"
data$scode[data$sex=="F"] <- "2"
to convert to numbers, and:
data$scode <-
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
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 =
2007 Mar 28
2
RV: By sentence
Hi dear listers
Do you know how to made a mean by one or more categorical variables?
I can do that quite easy on SAS by in R I just can't do it E.g.
Some fishes
Sex Lenght
male 15
fema 20
fema 17
fema 19
male 18
So the idea is mean(Lenght) by sex, in order to have sex: Male
mean=XX Sex: Fema mean=YY
In this case is quite easy to do it by a loop, but I have a huge DB
so is not an
2012 Apr 12
3
Reading SPSS: underlying numerical codes
Dear people,
I have got a question concerning the underlying numerical codes when
reading an SPSS file into R.
I used the package foreign and when I look at a variable I get the verbal
codes.
I would like to know how it is possible to get the underlying numerical
codes as output, which are the same as in my SPSS file.
Thank you very much in advance for your help!
Marion
[[alternative HTML