Displaying 20 results from an estimated 9000 matches similar to: "Order data frame"
2009 Jun 11
4
Count observation
Hi listers,
I have the following code...
data<-as.matrix(c(1,2,3,4,5,6,7,8,9,10),nrow=10,ncol=1,byrow=TRUE)
n<-nrow(data)
m<-n-1
boot<-data[sample(m,replace=T),]
So, I need to count the number of times each observation was selected at the
sample with replacement...
Suppose I sampled...
4 5 1 3 7 5 1 4 7
So, I would count...
x count
1 2
2 0
3 1
4 2
5 2
6 0
7 2
8 0
9 0
10 0
2009 Sep 18
2
Sum according observation
Hi listers,
I have a simple doubt...
I need to manipulate the data base as:
var1 var2
7 0.1
7 0.1
8 0.12
10 0.15
12 0.18
20 0.31
I would like to aggregate the equal cases as var1 making the sum of var2...
I would get...
var1 var2
7 0.2
8 0.12
10 0.15
12 0.18
20 0.31
Thanks in advance,
Marcio
--
View this message in context:
2009 Aug 14
1
Simulation Function - Save results
Hi listers,
I am working on a simulation... But I am having some troubles...
Suppose I have a function A which produces two results (mean and
variance)...
Then I would like to simulate this function A with a function B many times
using the results from function A
For example:
#Function A
boot<-function(a,b,c){
mean_boot<-(a+b)/2
var_boot<-c
#list(a=a,b=b,c=c)
return(a)
}
Then I would
2010 Sep 03
7
Function Gini or Ineq
Hi listers,
Does it necessary to install any package in order to use the GINI or INEQ
functions.
If I use the following command the R tells me that didn't find the GINI
function.
x<-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261)
G<-gini(x)
Thanks in advance,
Marcio
--
View this message in context:
2010 Sep 14
4
If then else with command for
Hey listers,
I am trying to do something simple... Check the program below...
I would like to create a variable named COLOR according to the conditions
that I stablished... But the problem is that it seems that my variable COLOR
is checking just on sample, may be last in the loop... Certainly, I am
missing something...
Thanks in advance,
Marcio
2009 Mar 26
2
Data manipulation - multiplicate cases
Hi listers,
I am trying to arrange my data and I didn't find any information how to do
it!
I have a data with 3 variables: X Y Z
1-I would like to multiplicate de information of X according to the number I
have for my Y variable...
2-Then I want to identify with a dicotomic variable by the number according
my variable Z from X...
I can do the first part by...
z<-rep(x,y)
But I don't
2009 Feb 24
2
Transpose array
Hi Listers,
Is there a way that I can transpose an array...
Suppose I have the following array...
x<-array(c(1,2,3,4),dim=c(1,2,2))
, , 1
[,1] [,2]
[1,] 1 2
, , 2
[,1] [,2]
[1,] 3 4
And I would like to get the following result...
, , 1
[,1]
[1,] 1
[,2] 2
, , 2
[,1] [,2]
[1,] 3
[,2] 4
Thanks in advance,
Marcio
--
View this message in context:
2010 Sep 13
2
Condition %in%
Hi listers,
If I would like to check if a variable contains certain value, I would
write:
if (10 %in% x)
And If I would like to check the opposite, that 10 is not into x. How would
be?
Thanks in advance,
Marcio
--
View this message in context: http://r.789695.n4.nabble.com/Condition-in-tp2538110p2538110.html
Sent from the R help mailing list archive at Nabble.com.
2009 Nov 24
4
Graphic Device - View/get all graphics
Hi Listers,
I am producing some graphics that the commands are in a FUNCTION...
The problem is that I end up viewing just last graphic and in my FUNCTION
there are 4 graphics with the PAR command function... Like those below...
How do I view/get the other 3 graphics? Any help?
Thanks in advance...
histogram<-par(mfrow=c(1,2))
hist(rw_mean_app,main='Bootstrap Method
2010 Feb 25
1
read.table (trying one more time)
Hey listers,
I've posted this doubt other day... But I am still having a hard time...
I have a MAC and I am not getting how to use the read.table command...
At the bottom of the FINDER application I have the following path:
Macintosh HD>Usu?rios>User>Marcio>UdeM>Travail Dirig?>Data>MU284
Population.txt
I didn't find out how I could copy and paste this path as it is
2009 Mar 31
1
Package candisc
Hi listers,
I am working on an canonical discriminant analysis, but I am having some
trouble to use the CANDISC function... I just installed the last R version
and installed the package CANDISC... But, I am getting the following message
because about a permission:
The downloaded packages are in
C:\Users\Marcio\AppData\Local\Temp\Rtmpz2kFUm\downloaded_packages
updating HTML package descriptions
2009 Aug 18
1
Simulation function
Hi listers,
I've been looking for a procedure, but I am not succeding...
I have a function that give multiple results...
Then, I would like to simulate this function n times, so I need to save/keep
the n multiple results, in order to calculate my desired statistics...
I have already tried with the RETURN and LIST FUNCTION, but I am not getting
it right...
An example of what I am looking for
2009 Apr 01
2
Matrix multiplication - code problem
Hi listers,
I am having some trouble in a matrix multiplication...
I have already checked some posts, but I didn't find my problem...
I have the following code...
But I am not getting the right multiplication...
I checked the dimension and they are fine...
id_y <- array(1:10,dim=c(2,1,5))
id_yt<-aperm(id_y,c(2,1,3))
m_id<-array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3]))
for (i in
2010 Sep 20
1
Size of the legend
Hello,
Which would be the command to change the size of the legend.
I checked at the help and I found out something about TEXT.WIDTH, but I am
not sure if is what I want.
Any help!
Thanks in advance,
Marcio
--
View this message in context: http://r.789695.n4.nabble.com/Size-of-the-legend-tp2547601p2547601.html
Sent from the R help mailing list archive at Nabble.com.
2010 Apr 12
3
Figures within tables [slightly off-topic]
Dear R-listers
I am writing a manuscript for a scientific journal in clinical medicine.
I have three groups of patients, and I present a 10*3 table of their
characteristics in Table 1. Some of their characteristics, e.g. their
age, are on a continuous scale, others are dichotomous. I am thinking of
presenting the age distribution in each group as miniature graphs, each
of which must fit in one
2008 Nov 24
14
how to test for the empty set
Dear R-help,
I first thought that the empty set (for a vector) would be NULL.
x <- c()
x
However, the documentation seems to make clear that there _many_ empty
sets depending on the vector's mode, namely, numeric(0), character(0),
logical(0), etc. This is borne out by
y <- letters[1:3]
z <- letters[4:6]
intersect(y,z)
which, of course, is non-NULL:
is.null(character(0)) #
2009 Jun 22
3
What has happened to the R-Help Google Groups Archive? Alternative?
Greetings,
I usually read this mailing list through google groups
(http://groups.google.com/group/r-help-archive), but when I opened the
webpage this morning it said: "The group named r-help-archive has been
removed because it violated Google's Terms Of Service."
Is there an alternative website which uses a similar structure to
google groups? I had a quick browse on the R Wiki
2010 Aug 11
1
Graphic Dispersion - Colored Points
Hey folks,
I have a graphic of dispersion...
I would like to color some specific points (x,y) according to another
indicator variable, for example:
x<-rnorm(5)
y<-rnorm(5)
ind<-(1,0,0,1,0)
plot(x,y)
Any suggestion, thanks...
Marcio
--
View this message in context: http://r.789695.n4.nabble.com/Graphic-Dispersion-Colored-Points-tp2322011p2322011.html
Sent from the R help mailing list
2010 Jul 13
3
export tables to excel files on multiple sheets with titles for each table
Hello R-users,
Checking the archives, I recently came across this topic:
"export tables to Excel files"
(http://r.789695.n4.nabble.com/export-tables-to-Excel-files-td1565679.html#a1565679),
and the following interesting references have been proposed:
http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows
2010 Oct 19
1
could not find function "hmatplot"
I need a picture like this:
http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38
http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38
but when I try compile it
require("hexbin")
data(NHANES)# pretty large data set!
good <- !(is.na(NHANES$Albumin) | is.na(NHANES$Transferin))
NH.vars <- NHANES[good,