Dear r-help,
Could you help me to find the function which change the size of matrix .
Best Regards
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posti
Background: Our research group collected data from students via the web
about their drinking habits (alcohol) over the last 90 days. As you
might guess, some students seem to have lost interest and completed some
information but not all. Unfortunately, the survey was programmed to
"pre-popu
Is it [server/rserve] running on Windows or Linux?
-c
On 4/26/2010 2:19 PM, Nupur Gupta wrote:
> Hi,
> I am trying to connect to RServe across a network.
>
> I had put RServe on my local machine and it worked just fine. When am try to
> connect to it across a network - it is able to go through the
Jonathan,
You can find the permutation of A that maximizes its trace by minimizing
||PA - I|| in Frobenius norm, where P is the permutation matrix, A is a
square matrix, and I is the identity matrix.
Here is the code that solves the abovementioned problem:
pMatrix.min <- function(A, B) {
# finds
I am trying to understand the code for lm.ridge from the MASS package.
Here is the part I am having trouble understanding:
if(Inter <- attr(Terms, "intercept"))
{
Xm <- colMeans(X[, -Inter])
Ym <- mean(Y)
p <- p - 1
X <- X[, -Inter] - rep(Xm, rep(n, p))
Y <- Y - Ym
} else Ym <- Xm <- NA
Xscale <-
If you like the idea of ODFWeave, but don't want to trasition to open office
then you may want to look at sword from the same group that brought us RExcel
(http://rcom.univie.ac.at/download.html). It looks like Sword is still in
beta, but it plans to do the same for MSWord as ODFWeave does for
Greetings all.
I'm starting analysis in R on a reasonably sized pre-existing dataset, of 583
variables and 1127 observations. This was an SPSS datafile, which I read in
using the read.spss command using the foreign package, and the data was
assigned to a data.frame when it was read in. The defa
Does this do what you want?
rainsnow <- rbind( c(0,1,2,3,2,1,0), c(2,2,1,0,0,1,2) )
rainsnow2 <- rbind( rainsnow[1,], -rainsnow[1,], -rainsnow[2,] )
fig=barplot(rainsnow2, horiz=TRUE, space=0, col=c("grey70",NA,
"white"), axes=FALSE)
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Inte
On Apr 26, 2010, at 3:18 PM, anderson nuel wrote:
Dear r-help,
Could you help me to find the function which change the size of
matrix .
?dim
Best Regards
David Winsemius, MD
West Hartford, CT
__
R-help@r-project.org mailing list
https://s
On Apr 26, 2010, at 3:58 PM, anderson nuel wrote:
I would find function which change the size automatically.
Read the help page again. You have too quickly formed an erroneous
conclusion.
For example:
> A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4))
> A
[,1] [,2] [,3] [,4]
[1,]
A couple of additions to the suggestions that you have already received:
1. you can use par(mfrow=c(r,c)) to set up the plotting areas, then us
par(mfg=c(r,c)) to tell R which frame to plot into.
2. you could start with an empty plot and use the subplot function
(TeachingDemos package) to place
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of David Atkins
> Sent: Monday, April 26, 2010 12:23 PM
> To: r-help@r-project.org
> Subject: [R] Dropping "trailing zeroes" in longitudinal data
>
>
> Background: Our research gro
On Apr 26, 2010, at 3:39 PM, Gosse, Michelle wrote:
Greetings all.
I'm starting analysis in R on a reasonably sized pre-existing
dataset, of 583 variables and 1127 observations. This was an SPSS
datafile, which I read in using the read.spss command using the
foreign package, and the data
Hi,
I just installed R 2.11.0 Win32 and tried to use write.csv (or
write.table) to write a 121000x26 data frame. This crashes R.
The dataframe was written OK in R 2.10.1.
I tried up to 108000 rows and the file was written OK. But then going
to 109000 causes the crash.
Anyone else see this
I would find function which change the size automatically.
For example:
> A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4))
> A
[,1] [,2] [,3] [,4]
[1,]1 1086
[2,]42 119
[3,]753 12
B=func(A,2,6)
B becomes:
13579 11
24
You can use matrix:
A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4))
B <- matrix(A, 2, 6)
On Mon, Apr 26, 2010 at 4:58 PM, anderson nuel wrote:
> I would find function which change the size automatically.
>
> For example:
>
> > A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4))
> > A
> [,1] [,2] [
The set.seed function works like you show. If you want to get a little fancier
you can use the char2seed function from the TeachingDemos package, then you
could set you seed with something like:
> char2seed('jimmy')
Or another string that represents the simulation.
--
Gregory (Greg) L. Snow
The usual way to speed up permutation testing is to sample from the set of
possible permutations rather than looking at all possible ones.
If you show some code then we may be able to find some inefficiencies for you,
but there is not general solution, poorly written uses of apply will be slower
Is the fact that 0 is a possible and interesting value (even in being absent) a
property of the table? Or a property of the variable?
I would argue that it is probably a property of the variable, and this is the
better way to work with it in R (some older programs forced us to specify this
at t
On 26/04/2010 4:25 PM, N Klepeis wrote:
Hi,
I just installed R 2.11.0 Win32 and tried to use write.csv (or
write.table) to write a 121000x26 data frame. This crashes R.
The dataframe was written OK in R 2.10.1.
I tried up to 108000 rows and the file was written OK. But then going
to 109000
I see what your suggesting. Make the rain negative so that it plots on the
other side of the axis. The axis labels can be adjusted accordingly. That
makes it simple. Thanks for the help.
On Mon, Apr 26, 2010 at 3:49 PM, Greg Snow wrote:
> Does this do what you want?
>
> rainsnow <- rbind( c
I tried reading in your text file with the read.table statement
you provided. Everything worked fine for me - str() shows that
all values are integers, and functions such as summary()
work as anticipated.
You don't tell us *what* you are trying to do. One possible source
of error is that read.tabl
It would be quicker, and easier, to use save/load to keep your temporary
output. Therefore you would not have to be concerned with a structure that
would be compatible to write.table/read.table.
2010/4/26 Laetitia Schmid
> Hi,
> I've had a little problem for several weeks now. It is annoying an
Bill--
Awesome; the code is perfect (for what we need).
Thank you so much for your help.
cheers, Dave
Dave Atkins, PhD
Research Associate Professor
Department of Psychiatry and Behavioral Science
University of Washington
datk...@u.washington.edu
Center for the Study of Health and Risk Behavi
Hello!
I have a dataset with the following two vectors:
year<-c(1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009)
piproute<-c(0.733
Yes, I suspect that I will end up using a sampling approach, but I'd
like to use an exact test if it's at all feasible.
Here are two samples of data from 3 subjects:
Sample SubjC1 C2
44 1 0.0093 0.0077
44 2 0.0089 0.0069
44 3 0.051 0.0432
44 4
I don't seem to be able to duplicate the problem. Using your read.table
command I get a data.frame (which is of course a type of list) and something
like sum(dat1[,1] gives me a numerical result.
What variable is giving you the not numerical error message
--- On Mon, 4/26/10, Laetitia Schmid
On 26-Apr-10 21:19:51, Laetitia Schmid wrote:
> Hi,
> I've had a little problem for several weeks now. It is annoying and
> therefore I will ask for help:
> When I write a script with several iterations, I make it write out a
> text file to save the data during the run. For example I write:
> if (i
Charlotte,
Try:
birds.lo <- loess(piproute~year,span=.25)
# play with span to see your desired pattern
birds.pr<-predict(birds.lo, data.frame(year = seq(1967, 2009, 1)),
se = FALSE)
#
plot($year,birds.pr$fit,ylim=c(0,5))
par(new=T)
plot(year,birds.pr$fit,pch="+",col=2,ylim=c(0,5))
--
Clint B
I suspect that you may have to construct the legend by hand (well, by explicit
text commands anyway)
Something like this seems to work and it should not be that difficult to write
a function to handle the text commands.
plot(1:10,10:1,lty=1,type='b', lwd=2,pch='a')
text(1.4,6, label="-a- ",
I'm not sure about "plotmeans" but this is usually the way I plot means with
lattice:
library(lattice)
x <- runif(48, 2, 70)
data <- data.frame(x)
data$factor1 <- factor(c("A", "B", "C", "D"))
data$factor2 <- factor(c("X", "Y", "Z"))
data.mean <- with(data, aggregate(data$x, by=list(factor1=fact
Hi
How about ... ?
library(grid)
# grid.newpage()
grid.text(expression(italic(P[SF]^{""%up%""})))
... or possibly a bit easier to read ...
grid.text(expression(italic(P[SF]^symbol("\255"
Paul
salca...@obelix.umh.es wrote:
Hi all,
I need an R expression, expression() to get the foll
Thank you Petr, Gustaf and Gabor. Your help is much appreciated.
I have tried:
dataset[!duplicated(dataset[,-2]),]
and it solves my problem.
Thanks,
Chris
--
View this message in context:
http://r.789695.n4.nabble.com/Remove-duplicated-rows-tp2023065p2065997.html
Sent from the R help mailing
Is there a way to use plotmeans function of Gplots in a trellis view with the
trellis groups defined by a column?
--
View this message in context:
http://r.789695.n4.nabble.com/plotmeans-in-trellis-view-tp2065860p2065860.html
Sent from the R help mailing list archive at Nabble.com.
Hi all,
One subtlety is that the drop argument only works if you specify 2 or
more indices e.g. [i, j, ..., drop=F]; but not for a single index e.g
[i, drop=F].
Why doesn't R complain about the unused "drop=F" argument in the
single index case?
Cheers,
- Stu
a = matrix(1:10, nrow=1)
b = matrix(
Hi,
I'm having trouble running 'lars'. When I install it I get the following
warning:
>install.packages('lars')
Warning in install.packages("lars") :
argument 'lib' is missing: using
'C:\Users\Anna\Documents/R/win-library/2.10'
--- Please select a CRAN mirror for use in this session ---
trying U
Hi.
I recently upgraded my R installation to 2.11.0 on Windows XP (SP3) without
changing any firewall settings. When I attempted to update my package list,
the 'Select a mirror' took much longer than it normally did, and after I
finally selected the site, I saw:
--- Please select a CRAN mirror fo
There was a notice earlier today about a power outage affecting the main
CRAN site..
For installing packages, try:
install.packages("packagename", repos="http://cran.wustl.edu";)
or to perform an upgrade:
update.packages(repos="http://cran.wustl.edu";)
until the main CRAN site has been resolve
Dear All,
Does anyone know how to get StatET to do automatic word wrapping for
Sweave document? I am new to StatET, so please pardon me if I missed
something obvious. Many thanks.
Best,
Shige
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
On Mon, 26 Apr 2010, Stu wrote:
Hi all,
One subtlety is that the drop argument only works if you specify 2 or
more indices e.g. [i, j, ..., drop=F]; but not for a single index e.g
[i, drop=F].
Wrong.
a <- structure(1:5,dim=5)
dim(a)
[1] 5
dim(a[2:3,drop=F]) # don't drop regardless
[1] 2
On Mon, 26 Apr 2010, Marshall Feldman wrote:
So why not have the appropriate
scripts ask a few questions upon the first installation of R (e.g., "Do you
want to configure R with a "global" library for packages to make future
upgrading easier?") and at upgrade time ("Your previous version of R
Hi Ben it's working good except no values of 4th column in output.
And also if the file is large I'm getting the following error.
Error in pf(q, df1, df2, lower.tail, log.p) :
Non-numeric argument to mathematical function
I rechecked if I have any non numeric arguments the defined columns.
I
Hi,
I am trying to place my own functions in the nlme environment:
The following statement works:
environment(coef.corSPT) <- environment(getS3method("coef","corSpatial"))
but this one returns an error:
environment(get("coef<-.corSPT")) <-
environment(getS3method("coef<-","corSpatial"))
Error
Hi R users,
Does anyone know how to change the size of 3d charts? I'm using surface3d in
rgl package, opening a new window each time to display the chart. I want it
so that the chart fills the whole window, because when I output it to png, I
don't want all the white space around the chart (right n
Rolf: "Well then, why don't you go away and design and build your own
statistics and data analysis language/package to replace R?"
What a nice reply! The fellow is just trying to understand R. That
response reminds me of citizens of my own country who cannot abide by
any criticism of the USA: "If
Thank you so much for the help.
Is the idea behind doing this to convert the text file to a dataframe to allow
me to work with and manipulate it? Also, if I do convert it to a dataframe how
do I reconvert it to a text file so that I can run it as a properly formatted
input file in the wat
Hi:
> On Mon, Apr 26, 2010 at 8:01 AM, steven mosher wrote:
> Thanks,
> I was trying to stick with the base package and figure out how the base
routines worked.
If you want to use base functions, then here's a solution with aggregate:
(the Id column
was removed first):
> with(DF, aggregate(DF[
Michael Steven Rooney wrote:
Hi,
I am trying to place my own functions in the nlme environment:
I'm not that does what you want. It doesn't place your function in the
environment, it attaches the environment to your function. The
difference is that other functions won't see yours, but y
Dear R help,
Is there a package which performs the Bhapkar V test (or any of the
Bhapkar-Deshpande L-type tests), preferably on the same sort of data
set input which kruskal.test() takes? I haven't been able to find
anything so far (the one reference to Bhapkar seems to be some other
test, though
See ?assignInNamespace
On Mon, Apr 26, 2010 at 9:49 PM, Michael Steven Rooney
wrote:
> Hi,
>
> I am trying to place my own functions in the nlme environment:
>
> The following statement works:
>
> environment(coef.corSPT) <- environment(getS3method("coef","corSpatial"))
>
> but this one returns a
Mandy Xu wrote:
Hi R users,
Does anyone know how to change the size of 3d charts? I'm using surface3d in
rgl package, opening a new window each time to display the chart. I want it
so that the chart fills the whole window, because when I output it to png, I
don't want all the white space around
Thanks Charles, for clarifying.
My statement holds for matrices, which are 2 dimensional. And, as you
mentioned, a single index implies vector indexing where the drop
argument doesn't make sense. I am somewhat relieved, given this new
understanding.
But I am still puzzled as to why R
Thanks.
How do I make my function visible to others? Will assignInNamespace do that?
On Mon, Apr 26, 2010 at 10:23 PM, Gabor Grothendieck <
ggrothendi...@gmail.com> wrote:
> See ?assignInNamespace
>
> On Mon, Apr 26, 2010 at 9:49 PM, Michael Steven Rooney
> wrote:
> > Hi,
> >
> > I am trying to
I tried editing the corExp function (added a line) within the nlme
environment with the following code, but it looks like my declaration did
not have any effect. I am guessing it is locked some how. Is there an easy
way to do this or am I treading into complicated waters? (I just picked up R
a year
See ?lockBinding
On Mon, Apr 26, 2010 at 11:20 PM, Michael Steven Rooney
wrote:
> I tried editing the corExp function (added a line) within the nlme
> environment with the following code, but it looks like my declaration did
> not have any effect. I am guessing it is locked some how. Is there an
On Mon, 26 Apr 2010, Stuart Andrews wrote:
Thanks Charles, for clarifying.
My statement holds for matrices, which are 2 dimensional. And, as you
mentioned, a single index implies vector indexing where the drop argument
doesn't make sense. I am somewhat relieved, given this new understandi
Hi,
I'm using the hist function to plot the frequency of 21 variables, but it
keeps starting the x-axis from 0 and adding variables 1 and 2 together (all
other vairables have the correct frequencies). I suspect it adds 1 and 2
together so that 0 can fit in with demarcations at intervals of 5. Usi
Hello.
I have a quick question.
I try to use logit regression, to work out probabilities in the sport event.
I have work out probabilities for group of 2 players:
p1 - probability, what player1 will beat player2
p2 - probability, what player2 will beat player1
pt - tie probability, p1 <- 1 - p1
Thanks John and thanks to all!
Seems this requires a lot of effort anyway.
So maybe it is better to take a different approach: take the legend out
of the chart and put it on a plot.new() on the right of the chart, use
only colored letters but make them larger to be visible.
Thanks!
R users
Thanks in advance
Could someone tell me what this condition means:
if ( a < 10 | | j > 100)
Thanks
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
On 2010-04-26 20:05, Matthew Keller wrote:
Rolf: "Well then, why don't you go away and design and build your own
statistics and data analysis language/package to replace R?"
What a nice reply! The fellow is just trying to understand R. That
response reminds me of citizens of my own country who c
Hello,
Thanks for your help, I have played around with the suggestion a bit
but I can still not sub-setting in the way I need
If I have a matrix x as follows:
> x <- matrix(c("BA1y1","BA2y3","C3A1r1y1","C3A2r2y2t4","C3r2y1y1",1,2,3,
11,12)
, nrow=5, ncol=2,
dimnames=list(c("a","b","c","d","e")
Type
?"||"
and read the help page.
If it helps, the statement is equivalent to
if( (a < 10) || (j > 100) )
-Peter Ehlers
On 2010-04-26 23:00, assaedi76 assaedi76 wrote:
R users
Thanks in advance
Could someone tell me what this condition means:
if ( a< 10 | |j> 100)
Thanks
trying setting
br = 40
inside the hist, and check if that helps...
(breaks won't do it for you either way)
Tal
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biost
Hi Karl,
I don't think this is the solution, but just in case -
the coin package has a reference for the: "homogeneity statistic W of *
Bhapkar* (1966)"
Might it be related to V test ?
Best,
Tal
Contact
Details:---
Contact me: t
The CRAN website is down, and will remain so for the next few hours, see
link for alternative images:
http://www.r-bloggers.com/r-project-websites-down/
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read
Hi:
This seems to be easier to pull off if x is a data frame rather than a
matrix.
x <- data.frame(GCM = c("BA1y1","BA2y3","C3A1r1y1","C3A2r2y2t4","C3r2y1y1"),
y = c(1:3, 11, 12), stringsAsFactors = FALSE)
x$val <- as.numeric(substring(lapply(strsplit(x$GCM, 'y'), '[
Hi Clint,
Thank you for your help with the code. The span recommendation really
improved the fit of my LOESS curve. I appreciate your thoughtful
assistance!
My remaining question is how could I go about identifying the
inflection points for the LOESS curve? I was thinking about trying to
find the
101 - 168 of 168 matches
Mail list logo