Displaying 20 results from an estimated 7000 matches similar to: "Table orderd by frequencies"
2008 Sep 11
2
Handling time-series-Data
Dear List,
I ran into some problems with time-series-Data.
Imagine a data-structure where observations (x) of test attendants (i) are made a four times (q) a year (y). The data is orderd the following way:
I y q x
1 2006 1 1
1 2006 3 1
1 2006 4 1
1 2007 1 1
1 2007 2 1
1 2007 3 1
1 2007 4 1
2 2006 1 1
3 2007 1 1
3 2007 2 1
I am looking for a way to count the attendants that at least have
2008 Jul 16
2
Group level frequencies
Dear List,
I have Multi-level Data
i= Indivitual Level
g= Group Level
var1= First Variable of interest
var2= Second Variable of interest
and I want to count the frequency of "var1" and "var2" on the group
level.
I found a way, but there must be a much simpler way.
data.ml <-
data.frame(i=c(1:8),g=as.factor(c(1,1,1,2,2,3,3,3)),var1=c(3,3,3,4,4,4,4
,4),
2008 Sep 09
2
exporting tapply objects to csv-files
Dear Everyone,
I try to create a cvs-file with different results form the table function.
Imagine a data-frame with two vectors a and b where b is of the class factor.
I use the tapply function to count a for the different values of b.
tapply(a,b,table)
and I use the table function to have a look of the frequencies as a total
table(a)
I would like to put both results together in one txt or
2008 Jul 08
4
Manipulate Data (with regular expressions)
Dear Everyone,
I try to automatically manipulate the data of a variable (class =
factor) like
x
220
220a
221
221b
B221
Into two variables (class = numeric) like
x y
220 0
220 1
221 0
221 1
221 1
y has to carry the information about the class (number or string) of the
former x-Variable.
I could do it by hand like
x[x == "220a"] <- 220
2010 Jul 06
3
Selection with changing number of columns
Dear list,
I'm looking for a way to select rows of a data.frame with changing number of columns (constraint) involved.
Assume a data (d) structure like
Var.1 Var.2 Var.3
9 2 1
2 9 5
1 2 1
I know the number of involved columns.
Is there a way to generate the following selection automatically (maybe for loop), so that it makes no difference if there are two or ten columns involved.
2010 Jul 05
3
Counting defined character within String
Dear list,
I'm looking for a way to count the number of "|" within an object.
The character "|" is used to separated ids.
Assume a data (d) structure like
Var
NA
NA
NA
NA
NA
1
1|2
1|22|45
3
4b|24789
I need to know the maximum number of ids within one object. In this case 3 (1|22|45)
Does anybody know a better way?
Thanks
Mit freundlichen Gr??en
Andreas Kunzler
2008 Jul 24
3
incrementing for loop by 2
Dear List-serv members:
How can I structure a for loop so that it will increment the counter by two using R? I am just looking for a simple example that shows where the incrementing part should go. Thanks!
Jennifer
--
Jennifer Hayes Clark
Assistant Professor
Department of Political Science
University of Houston
Houston, TX 77204-3011
[[alternative HTML version deleted]]
2008 Jul 18
2
generate repeats of a vector's elements
Dear all,
I have got a question for generating repeats of a vector's elements.
Please don't hesitate to email me back and say that it is very easy
although I can't find a method to solve it.
If I have a n-vector b, whose elements are b[1], b[2], ..., b[n], how
can I generate such a vector
b[1], b[1], b[2], b[1], b[2], b[3], b[1], b[2], b[3], b[4],
......, b[1], b[2], ...,
2008 Jul 21
3
vector help
hi
I have vector test. It has 3 elements. I want to join the three into one
vector.
"Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY-157- 20".
how can i do it.
> class(test)
[1] "character"
> test
[1] "Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY" "157"
[3] "20"
Ramya
--
2008 Jul 25
3
Help with rep
Hi
Is it possible to use the rep command (or maybe some other "shortcut") to create a vector with the following format:
4 3 4 2 3 4 1 2 3 4
Any help is much appreciated.
Thanks
Jacob
Jacob L van Wyk
Department of Statistics
University of Johannesburg, APK
Box 524
Auckland Park 2006
South Africa
Office Tel: +27 11 559 3080
Fax: +27 11 559 2832
[[alternative HTML version
2008 Aug 20
4
Conversion - lowercase to Uppercase letters
I would like to know how to convert a string with characters to all
uppercase or all lowercase? If anyone could let me know if there exists a
function in R for the conversion, that will be very helpful.
Regards,
Suman
[[alternative HTML version deleted]]
2008 Jul 28
3
Fill in NA values in vector with previous character/factor
I have a vector of data (species names) interspersed with NA values
and I want a function to "fill in the blanks", replacing NA values
with whatever the last species name was.
For example the vector:
"A","B",NA,NA,"C",NA,NA,NA,NA,"D",NA,NA.
should evaluate to:
"A" "B" "B" "B" "C"
2008 Jul 20
3
Order of columns(variables) in dataframe
Dear R experts,
I have a dataframe with 4 columns (variables). I want to redorder (or reposition) these columns on the basis of a value in its last row. e.g.
df1<-data.frame( v1= c(2,3,1,9,5), v2=c(8,5,12,4,11), v3=c(7,8,2,6,9), v4=c(1,4,6,3,6))
> df1
v1 v2 v3 v4
1 2 8 7 1
2 3 5 8 4
3 1 12 2 6
4 9 4 6 3
5 5 11 9 6
I wanto to get the order of df1 on the basis of
2008 Jul 20
2
fill in area between 2 lines with a color
Hi - I'd like to have the area between 2 lines on a x-y plot be filled with
grey, but I haven't had
any luck using polygon or rect. (In reality, I'd like to do this for twice
- once for a low group and once for a high group - and then I'd like to plot
a set of data points for a 'normal' group together with these 2 grey areas.)
Here's a simple example of the 2 lines:
2008 Aug 15
2
Combination with repetition
Hi there! I can't find any information about creating combinations
with repetitions in R. The function combn() does create combinations,
but _without_ repetitions.
Here is what I need to do:
svIter <- 1000
xx <- matrix(rnorm(m*n), c(m, n))
sequence <- seq(range(xx)[1], range(xx)[2], length.out = svIter^(1/q))
expand.grid(secuence, secuence, .../q times/..., secuence)
That is,
2008 Aug 15
5
x-axis with month and year
Hey list!
I have a csv-file with two variables: (Date,CMI)
Date,CMI
Jan-93,3.24
Feb-93,-2.56
.
.
.
Dec-06, 8.25
When I want to plot this dataset, R is sorting the date in alphabetical
order. Is there any way to tell R not to do it?
I know it is probably an easy issue but I couldn't find a solution so
far. I have seen so many tips already but can't apply it on my own
dataset.
Thank
2008 Aug 01
3
Newbie question: How to use tapply() on several vectors simultaneously
Dear R users,
I have a newbie-question that I couldn't resolve after reading through
several pieces of documentation and searching the archive.
I have a data.frame containing experimental data from a group experiment
in psychology. Each line represents a single participant, but
participants were assigned to groups of three or four persons. One
variable indicates each participants'
2008 Aug 16
4
Dealing with NaN's in data frames
I am looking for the most efficient way to replace all occurrences of NaN in a data frame with NA. I can do this with a double loop, but it seems that there should be a higher level and more efficient way. With is.na, I could use ifelse, but if.nan seems not to have similar capabilities.
TIA,
Jon Peck
Jon K. Peck
jkpeck@aya.yale.edu
[[alternative HTML version deleted]]
2008 Jul 17
5
calculate differences - strange outcome
Dear List,
I ran into some trouble by calculating differences. For me it is
important that differences are either 0 or not.
So I don't understand the outcome of this calculation
865.56-(782.86+0+63.85+18.85+0)
[1] -1.136868e-13
I run R version 2.71 on WinXP
I could solve my problem by using
round()
but I would like to know the reason.
Maybe someone can help me?
Thanx
2008 Jul 18
2
column wise paste of data.frames
Hi everybody!
I'm sure that I overlook something and feel quite stupid to ask, but I
have not found an easy solution to the following problem: Take e.g. the
Orthodont data from the nlme package:
> head(Orthodont)
Grouped Data: distance ~ age | Subject
distance age Subject Sex
1 26.0 8 M01 Male
2 25.0 10 M01 Male
3 29.0 12 M01 Male
4 31.0 14 M01 Male