Hi Gang Chen,
If I have the right idea:
for(zval in levels(myData$Z))
crossprod(as.matrix(myData[myData$Z==zval,c("X","Y")]))
Jim
On Wed, Aug 24, 2016 at 8:03 AM, Gang Chen wrote:
> This is a simple question: With a dataframe like the following
>
> myData <- data.frame(X=c(1, 2, 3, 4), Y=c(4, 3
> On Aug 23, 2016, at 3:03 PM, Gang Chen wrote:
>
> This is a simple question: With a dataframe like the following
>
> myData <- data.frame(X=c(1, 2, 3, 4), Y=c(4, 3, 2, 1), Z=c('A', 'A', 'B',
> 'B'))
>
> how can I get the cross product between X and Y for each level of
> factor Z? My difficu
Bert: Yes, with some fiddling of axes labels this looks like just what I
needed.
Thank you.
Brian
Brian S. Cade, PhD
U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO 80526-8818
email: ca...@usgs.gov
tel: 970 226-9326
On Tue, Aug 23, 2016 at 3
This is a simple question: With a dataframe like the following
myData <- data.frame(X=c(1, 2, 3, 4), Y=c(4, 3, 2, 1), Z=c('A', 'A', 'B', 'B'))
how can I get the cross product between X and Y for each level of
factor Z? My difficulty is that I don't know how to deal with the fact
that crossprod()
Is this of any help? (found by simple google search):
http://stackoverflow.com/questions/6392266/rotating-the-grid-to-plot-horizontal-errors-bars-with-hmiscxyplot-in-r
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
Is there a simple way to transpose the x and y axes with the xYplot()
function in the Hmisc package, where y is a vector of point estimate and
lower and upper confidence interval endpoints? What I'm looking for is
something akin to coord_flip() used with ggplot().
Brian
Brian S. Cade, PhD
U. S.
Or maybe a print() statement on the table() in the loop.
print(table(...))
Rui Barradas
Citando David Winsemius :
>> On Aug 23, 2016, at 10:01 AM, Juan Ceccarelli Arias
>> wrote:
>>
>> Im running this but the code doesn't seem work.
>> It just hangs out but doesn't show any error.
>>
>> fo
Compare what happens with these two command:
for (i in 1:3) { table(letters[1:4]) }
for (i in 1:3) { print(table(letters[1:4])) }
Then try modifying your loop similarly.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 8/2
Hello,
Where does read_dta come from? You should also post the library() instruction.
Try to run the code without the loop, with just one file and inspect
xxx to see what's happening.
xxx <- read_dta(fuente[1])
str(xxx)
table(xxx$cise, xxx$sexo)
Rui Barradas
Citando Juan Ceccarelli Arias :
> On Aug 23, 2016, at 10:01 AM, Juan Ceccarelli Arias wrote:
>
> Im running this but the code doesn't seem work.
> It just hangs out but doesn't show any error.
>
>
> for (i in 1:length(fuente)){
>
> xxx=read_dta(fuente[i])
>
> table(xxx$cise, xxx$sexo)
>
> rm(xxx)
>
> }
I still find the
Im running this but the code doesn't seem work.
It just hangs out but doesn't show any error.
for (i in 1:length(fuente)){
xxx=read_dta(fuente[i])
table(xxx$cise, xxx$sexo)
rm(xxx)
}
On Tue, Aug 23, 2016 at 6:31 AM, wrote:
> Hello,
>
> The op could also use package sos to find that and oth
I'm not sure why you'd want to, but here's one way to do it:
plotdat2[rep(1:nrow(plotdat), each=100), ]
This puts all the replicates of each row together.
plotdat2[rep(1:nrow(plotdat), times=100), ]
while this repeats each row then starts over.
If that answer doesn't make sense, then you shou
?rep (to replicate indices)
plotdat2[rep(1:3,e=100), ]
This seemspretty basic. Have you gone through any R tutorials yet? If
not, please do so before posting further. There are many good ones on
the web.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming
Hi, There!
I have this data frame:
> plotdat2
FirmicutesLowerUpper fTissue2
1 63.48023 59.15983 68.11614 CAECUM
2 61.42512 57.24651 65.90875COLON
3 44.68343 41.62523 47.96632RUMEN
How can I replicate each line 100 times?
I`m new in R command line, so sorry if my quest
Hi,
Thanks Richard,
That was me playing with too many examples and having too many variables
just lying around. Thanks for the tip though.
On 22 August 2016 at 23:32, Bert Gunter wrote:
> Thanks, Rich. I didn't notice that!
>
> -- Bert
> Bert Gunter
>
> "The trouble with having an open mind is
Dear Martin,
Thank you for the solutions.
I've tried as per your codes and my problem solved :)
Thanks a lot!
Best regards,
Isaudin
On Tue, Aug 23, 2016 at 9:06 AM, Martin Maechler wrote:
> > Isaudin Ismail
> > on Thu, 18 Aug 2016 17:03:50 +0100 writes:
>
> > Dear Martin,
Hello,
The op could also use package sos to find that and other packages to
read stata files.
install.packages("sos")
library(sos)
findFn("stata")
found 374 matches; retrieving 19 pages
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19
Downloaded 258 links in 121 packages
The first package is re
Dear Juan
If this is a Stata 13 file the package readstata13 available from CRAN
may be of assistance.
On 22/08/2016 18:40, Juan Ceccarelli Arias wrote:
I removed the data,frame=True...
I obtain this warnings...
Error in read.dta(fuente[i]) : not a Stata version 5-12 .dta file
In addition: Th
> Isaudin Ismail
> on Thu, 18 Aug 2016 17:03:50 +0100 writes:
> Dear Martin, Following my earlier question on "error while
> fitting gumbel copula", I have also crated a new gist at
> https://gist.github.com/anonymous/0bb8aba7adee550d40b840a47d8b7e25
> for easy checki
> On Aug 22, 2016, at 11:33 PM, 이아름 wrote:
>
>
> Hi!
>
> I'm trying to do the non-parametric test for 2 factor mixed anova.
>
> I got 2 factors, one is within-subject factor, AGE(2levels), and the other is
> between-subject factor, Speed(6levels).
> One dependent variables, RT.
>
> The dat
Hi!
I'm trying to do the non-parametric test for 2 factor mixed anova.
I got 2 factors, one is within-subject factor, AGE(2levels), and the other is
between-subject factor, Speed(6levels).
One dependent variables, RT.
The data, I got, is not satisfied with the normality and homogeneity of
Thanks for getting back to me. Worked like a charm.
Ken
kmna...@gmail.com
914-450-0816 (tel)
347-730-4813 (fax)
> On Aug 22, 2016, at 11:45 PM, Thomas Mailund wrote:
>
> Hi Ken,
>
> You are trying to install R as a package. That won't work. The .pkg file you
> downloaded from https://cra
22 matches
Mail list logo