Dear R users,
I'm having some problems with the stack() and unstack() functions, and
wondered if you could help.
I have a large data frame (400 rows x 2000 columns), which I need to reduce
to a single column of values (and therefore 80 rows), so that I can use
it in other operations
Hi:
One answer is eval(substitute(...)): [Note: it's a good idea NOT to use the
same name on different objects - R is pretty good about distinguishing TEST
the function from TEST the data frame, but you could be playing with fire if
both objects have the same class but have different contents.
Hi:
It would help if you named your variables such that alphanumeric ordering
doesn't disturb your variable ordering. Having been burned by this a few
times, I've learned the basics of sprintf() :) Here's your example
revisited, along with an alternative stacking/unstacking display with
package
On 2011-03-11 17:10, jonbfish wrote:
Thanks again. I guess I have been fitting in splus gui and in R Commander, not
really calling it myself. I was thinking maybe there was a way to define it as
a class or something.
I will have to look at segments. Any thoughts if this might be easy to use
Dear R helpers
Suppose I have a data frame as given below
mydat = data.frame(x = c(1,1,1, 2, 2, 2, 2, 2, 5, 5, 6), y = c(10, 10, 10, 8,
8, 8, 7, 7, 2, 2, 4))
mydat
x y
1 1 10
2 1 10
3 1 10
4 2 8
5 2 8
6 2 8
7 2
On 2011-03-12 02:01, Dennis Murphy wrote:
Hi:
It would help if you named your variables such that alphanumeric ordering
doesn't disturb your variable ordering. Having been burned by this a few
times, I've learned the basics of sprintf() :) Here's your example
revisited, along with an
Dear Dennis and Peter,
Thank you for the suggestions - they work very well with my example data.
I *think* I've got it up and running using my real data (with 2000 columns)
too, with:
sprintf(%s%04d, X, c(1:2000))
then the stacking/unstacking operations.
Thanks again for the help
Best wishes,
On 10 March 2011 02:07, Xiaobo Gu guxiaobo1...@gmail.com wrote:
set transactions ...[35 item(s), 8 transaction(s)] done [0.00s].
That does not look right?
I think it's because there are to few sample records, so all the rules
are with 100% confidence
Sorry - I think you might have
Hi:
This problem came up the other day - see
http://stats.stackexchange.com/questions/7884/fast-ways-in-r-to-get-the-first-row-of-a-data-frame-grouped-by-an-identifier/7985#7985
Dennis
On Sat, Mar 12, 2011 at 3:20 AM, Vincy Pyne vincy_p...@yahoo.ca wrote:
Dear R helpers
Suppose I have a
Dear R users,
I'm trying to do betareg on my dataset.
Dependent variable is not normally distributed and is proportion (of condom
use (0,1)).
But I'm having problems:
gyl-betareg(cond ~ alcoh + drug, data=results)
Error in optim(par = start, fn = loglikfun, gr = gradfun, method = method, :
On Sat, 12 Mar 2011, Vlatka Matkovic Puljic wrote:
Dear R users,
I'm trying to do betareg on my dataset.
Dependent variable is not normally distributed and is proportion (of condom
use (0,1)).
But I'm having problems:
gyl-betareg(cond ~ alcoh + drug, data=results)
Error in optim(par = start,
Maybe I should include data:
results$cond
[1] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
[13] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
[25] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
[37] 0.001 0.001 0.020
Thanks sir for your reply. Unfortunately I couldn't figure out the solution.
Vincy
--- On Sat, 3/12/11, Dennis Murphy djmu...@gmail.com wrote:
From: Dennis Murphy djmu...@gmail.com
Subject: Re: [R] Identifying unique pairs
To: Vincy Pyne vincy_p...@yahoo.ca
Cc: r-help@r-project.org
Received:
Hi,
I have installed R on my computer with windows 7 . I also installed reshape
software, but I am not being able to work with melt cast commands . I have
chjecked the commands.It is not working.
Thankyou,
Deepika
[[alternative HTML version deleted]]
I would like to draw a circle on a graph I am plotting in R and use
the current plot's coordinate system.
The most basic functionality I am looking for is the ability to plot a
circle on an already existing graph by simply providing the xy
coordinates for it's centre and the radius.
I am also
Hello R users, Im having this strange problem.
http://r.789695.n4.nabble.com/file/n3350024/bad2.png
I have txt file of this format (X.X, Y.Y - random numbers, ...) with data
points:
nm A nm A nm A
X.X Y.Y X.X XX X.X
X.X Y.Y Y.Y Y.Y Y.Y
My script looks like this:
require(graphics)
Hi there,
I'm new to R, coming from gnuplot for the plotting facility...
I'm just wondering if there is a equivalent to the fit function of gnuplot in R?
If not, s there any good resource on fitting gaussians into a curve?
greetings,
Stefan
__
Solution:
main=HMF - main=HMF
--
View this message in context:
http://r.789695.n4.nabble.com/plot-generates-graph-with-coordinantes-written-over-it-tp3350024p3350163.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Hi:
The value of your title is a(n attached) data frame - perhaps you meant
'HMF' instead...
HTH,
Dennis
On Sat, Mar 12, 2011 at 2:41 AM, derek jan.kac...@gmail.com wrote:
Hello R users, Im having this strange problem.
http://r.789695.n4.nabble.com/file/n3350024/bad2.png
I have txt file of
Question 1:
I have a long list of variable names such as
first - c(one,two,three)
and what I want to do is create a list of lists ... where the names of each of
overall lists components are one,two, and three.
This is the same result as
second - list(one=list(),two=list(),three=list())
Is
Hello,
On Mar 12, 2011, at 8:32 AM, Maas James Dr (MED) wrote:
Question 1:
I have a long list of variable names such as
first - c(one,two,three)
and what I want to do is create a list of lists ... where the names
of each of overall lists components are one,two, and three.
This is the
On Sat, Mar 12, 2011 at 03:20:01AM -0800, Vincy Pyne wrote:
Dear R helpers
Suppose I have a data frame as given below
mydat = data.frame(x = c(1,1,1, 2, 2, 2, 2, 2, 5, 5, 6), y = c(10, 10, 10, 8,
8, 8, 7, 7, 2, 2, 4))
[...]
unique(mydat$x) will give me 1, 2, 5, 6? i.e. 4 values and
Please read the posting guide. It is not working doesn't give us any
clues. Tell us what you did and what happened.
Best,
Ista
On Sat, Mar 12, 2011 at 8:45 AM, Deepika deepikaoma...@gmail.com wrote:
Hi,
I have installed R on my computer with windows 7 . I also installed reshape
software, but
Hello R users,
I'm trying to do simulations for comparing cox and weibull
I have come across this problem:
Warning messages:
1: In survreg.fit(X, Y, weights, offset, init = init, controlvals = control,
:
Ran out of iterations and did not converge
2: In survreg.fit(X, Y, weights, offset, init
Dear sir,
Thanks a lot for the solution.
It was such a simple solution, but people like me close their minds and don't
think of data.frame as a whole and keep on thinking about vector elements only.
I also almost got the solution when I tried
qq = unique(pp)
(qq - sub( .*,, qq)) but this was
It may be a stupid question but have you loaded reshape?
library(reshape)
?melt
--- On Sat, 3/12/11, Deepika deepikaoma...@gmail.com wrote:
From: Deepika deepikaoma...@gmail.com
Subject: [R] how to use melt cast commands in R in window7
To: r-help@r-project.org
Received: Saturday, March
Is this of any use? http://tolstoy.newcastle.edu.au/R/help/06/04/25821.html
--- On Sat, 3/12/11, Allan Kamau kamaual...@gmail.com wrote:
From: Allan Kamau kamaual...@gmail.com
Subject: [R] Drawing a circle on an existing graph.
To: r-help@r-project.org
Received: Saturday, March 12, 2011,
On Sat, Mar 12, 2011 at 3:08 AM, Allan Kamau kamaual...@gmail.com wrote:
I would like to draw a circle on a graph I am plotting in R and use
the current plot's coordinate system.
The most basic functionality I am looking for is the ability to plot a
circle on an already existing graph by
Good morning, dear listers
I am wondering how to do string evaluation such that
model - glm(Y ~ [STRING], data = mydata) where STRING - x1 + x2 + x3
It is very doable in other language such as SAS.
Thank you so much for your insight!
__
2011/3/11 Albyn Jones jo...@reed.edu
but presumably what you really want would be based on a joint confidence
region for all the proportions.
I've had read On Exact Methods for Testing Equality of Binomial
Proportions by Akihito Matsuo, but still, this concept is for me unclear
and I got
On Mar 12, 2011, at 10:10 AM, Wensui Liu wrote:
Good morning, dear listers
I am wondering how to do string evaluation such that
model - glm(Y ~ [STRING], data = mydata) where STRING - x1 + x2 +
x3
It is very doable in other language such as SAS.
Also very doable in R. You need to
Vlatka Matkovic Puljic v.matkovic.puljic at gmail.com writes:
Maybe I should include data:
results$cond
[1] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
[snip]
[205] 0.950 0.960 0.980 0.980 0.999
2011/3/12 Vlatka Matkovic Puljic v.matkovic.puljic at gmail.com
Thank you so much, David. Your solution exactly suits my need.
formula() seems the key.
appreciate your help!
On Sat, Mar 12, 2011 at 10:22 AM, David Winsemius
dwinsem...@comcast.net wrote:
On Mar 12, 2011, at 10:10 AM, Wensui Liu wrote:
Good morning, dear listers
I am wondering how to do
That was also my first thought.
But I guess it has something to do with W and phihat
(which I'm struggling to check?)
2011/3/12 Ben Bolker bbol...@gmail.com
Vlatka Matkovic Puljic v.matkovic.puljic at gmail.com writes:
My first guess would have been that you had zeros and ones in
Vlatka Matkovic Puljic v.matkovic.puljic at gmail.com writes:
That was also my first thought.
But I guess it has something to do with W and phihat
(which I'm struggling to check
Again, it would help to post a reproducible example ...
hard to debug/diagnose by remote control. If you
So we'd had to debug either your code (which we do not have) or your
database server (or its connection).
Hence we cannot so very much without the code or reproducible examples.
Please also tell us the warnings you got when saying warnings().
Uwe Ligges
On 10.03.2011 16:51, Dr. Alireza
The nls function does nonlinear least squares fits.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Stefan
I would avoid eval(substitute(...)) in the function.
It makes the function hard to use in more general cases
(and hard to understand and subject to giving incorrect
answers in some cases).
Instead quote (or 'quote') the literal string that you pass
into the function. When you pass blue into the
У Срд, 09/03/2011 у 23:29 -0800, Dennis Murphy піша:
Hi:
Here's one approach, although I imagine there are more efficient ways.
# A function to strip spaces and return the first three non-blank elements
of a string
keyset - function(x) substr(gsub(' ', '', x)[1], 1, 3)
Hello to everybody
Stefan jobmensa at me.com writes:
[snip]
I'm just wondering if there is a equivalent to the fit function of
gnuplot in R?
If not, s there any good resource on fitting gaussians into a curve?
Try
?nls
?predict.nls
__
R-help@r-project.org
--- On Sat, 3/12/11, Allan Kamau kamaual...@gmail.com wrote:
From: Allan Kamau kamaual...@gmail.com
Subject: [R] Drawing a circle on an existing graph.
To: r-help@r-project.org
Received: Saturday, March 12, 2011, 3:08 AM
I would like to draw a circle on a
graph I am plotting in R and use
Hello R
I can not figure out, how to add text string or number to lines like on this
image:
http://r.789695.n4.nabble.com/file/n3350452/graph.png
I have some data series in text file.
My script:
require(graphics)
require(stats)
graf=read.table(file,header =FALSE,sep = , dec = ,,fileEncoding = ,
On Mar 12, 2011, at 10:56 AM, Allan Kamau wrote:
--- On Sat, 3/12/11, Allan Kamau kamaual...@gmail.com wrote:
From: Allan Kamau kamaual...@gmail.com
Subject: [R] Drawing a circle on an existing graph.
To: r-help@r-project.org
Received: Saturday, March 12, 2011, 3:08 AM
I would like to draw a
On Sat, Mar 12, 2011 at 10:22 PM, David Winsemius
dwinsem...@comcast.net wrote:
On Mar 12, 2011, at 10:56 AM, Allan Kamau wrote:
--- On Sat, 3/12/11, Allan Kamau kamaual...@gmail.com wrote:
From: Allan Kamau kamaual...@gmail.com
Subject: [R] Drawing a circle on an existing graph.
To:
Hi:
Since you didn't provide any data, you're stuck with my example instead.
# Generate three sine curves on (0, 2*pi)
x - seq(0, 2 * pi, length = 200)
df - data.frame(x, y1 = sin(x), y2 = sin(2 * x), y3 = sin(4 * x))
# Create a small function to type (n), where n is a number to be input
mytext
There are instances when assignment
should be indicated by - rather than =.
One example is the function Sys.time().
sytem.time( x=1:1) # x is interpreted as an argument and is an
error here.
system.time( x-1:1000) # times the creation of x with numbers 1 to 1
However, grouping the
I am new to R so I apologize if my question is trivial. I have not been able
to figure out whether what I want to do is even possible.
I have a data frame of stock ticker symbols which I store into R space from
a txt file as follows:
tickers - read.csv(stocks.txt, header=FALSE, sep=,)
tickers -
Dear All,
Debuting in R, I'm facing a problem.
I have 2 vectors, say 'a' et 'b', and I'd like to merge them according to
the proximity of their variable 'time'.
How to do to keep elements which satisfy (for example) 'a$time-b$time0.5'?
For example :
a
time x
1 1.0 4
2 2.2 5
3 5.2 6
b
On Mar 12, 2011, at 3:08 PM, algotr8der wrote:
I am new to R so I apologize if my question is trivial. I have not
been able
to figure out whether what I want to do is even possible.
I have a data frame of stock ticker symbols which I store into R
space from
a txt file as follows:
On Mar 12, 2011, at 4:14 PM, flymer wrote:
Dear All,
Debuting in R, I'm facing a problem.
I have 2 vectors, say 'a' et 'b', and I'd like to merge them
according to
the proximity of their variable 'time'.
How to do to keep elements which satisfy (for example) 'a$time-b
$time0.5'?
For
Thank you for reply. I think, in script you posted, I have to manually add
coordinates for label. I don't want do it manually. I would like to add
labels at the points, where the lines are maximally separated. (points of
maximum separation). Graphic representation of my data looks very similar to
Hi all,
I don't know if anyone has any thoughts on this. I have been trying to move
from SAS Proc Mixed to R nlme and have an unusual result.
I have several subjects measured at four timepoints. I want to model the
within-subject correlation using an autoregressive structure. I've attached
the R
Please look at the labcurve function in the Hmisc package. Here is one line
from the documentation of ?labcurve
For automatic positioning of labels or keys, a curve is labeled at a point
that
is maximally separated from all of the other curves.
As you, the documentation uses the same words
Problem solved:
require(graphics)
require(stats)
require(hmisc)
HBA=read.table(file,header =FALSE,sep = , dec = ,,fileEncoding = ,
encoding = unknown, skip=60,nrows=210)
attach(HBA)
labcurve( list( One= list( V1,V2), Two= list( V3,V4),
Three=list( V5,V6), Four= list( V7,V8), Five= list(
On Mar 12, 2011, at 6:35 PM, derek wrote:
Problem solved:
require(graphics)
require(stats)
require(hmisc)
HBA=read.table(file,header =FALSE,sep = , dec = ,,fileEncoding
= ,
encoding = unknown, skip=60,nrows=210)
attach(HBA)
labcurve( list( One= list( V1,V2), Two= list( V3,V4),
Sorry Alan but it's not my function. I just was looking for something similar
a while ago and googled to find The
ost whose url I sent you will have the name of the creator.
Actually I think I ended up just using symbols for my graph.
--- On Sat, 3/12/11, Allan Kamau kamaual...@gmail.com wrote:
use the sqldf package:
require(sqldf)
a
time x
1 1.0 4
2 2.2 5
3 5.2 6
b
time y
10 1
21 3
32 5
44 7
55 9
sqldf(
+ select a.time, a.x, b.y
+ from a, b
+ where abs(a.time - b.time) 0.5
+ )
time x y
1 1.0 4 3
2 2.2 5 5
3 5.2 6 9
On Sat,
Here is a working example that allows you to interactively label curves where
you want:
x - c(200,210,230)
y1 - c(0.1, 0.13, 0.1)
y2 - c(0.11, 0.15,0.1)
y3 - c(0.12,0.17,0.12)
df - data.frame(x, y1,y2,y3)
lab - c(0.1 mg/l,0.2 mg/l,0.3 mg/l)
plot(df$x, df$y1, type=l, col=blue, xlab=,
I am new to R and am sure this is simple, but I been unable to find a
solution.
I have 5 columns of data labeled X, Y, A,B,C. I can easily
xyplot(Y ~ X | A) but I want the colors of the symbols to be based upon the
values of B and the shape of the symbols to be determined by C. There are
On Mar 12, 2011, at 7:57 PM, Mark Linderman wrote:
I am new to R and am sure this is simple, but I been unable to find a
solution.
I have 5 columns of data labeled X, Y, A,B,C. I can easily
xyplot(Y ~ X | A) but I want the colors of the symbols to be based
upon the
values of B and the
If you are always using asp=1 then you can just do something like:
x - rnorm(100, 1, 5)
y - rnorm(100, 3, 4)
plot( x,y, asp=1)
r=2
nseg=360
x.cent - 5
y.cent - 7
xx - x.cent + r*cos( seq(0,2*pi, length.out=nseg) )
yy - y.cent + r*sin( seq(0,2*pi, length.out=nseg) )
lines(xx,yy, col='red')
Thanks David for the reply. I just tried the following with the same result:
library(tseries)
tickers - read.csv(testticker.txt, header=FALSE, sep=,)
tickers - tickers[1]
V1
1 XOM
2 COP
3 PBR-A
4 FFIV
5SU
6 PBR-B
tickers$V1 - as.character(tickers$V1)
tickers$V1
[1] XOM COP
thank you!
--
View this message in context:
http://r.789695.n4.nabble.com/confirmatory-factor-analysis-in-R-tp3347618p3351230.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Hi everyone .
I would like to integrate R with Microsoft Silverlight . I would like to
know whether we can connect R through any other software . If possible how ?
Could anyone help me with this
Thanks
--
Regards,
Vikram Selvaraju
Graduate Student
The University of Texas at Dallas
Hello
I have a large series of data value -- effectivly say the point across the
x-axis where a pitch crosses home plate. What I want to do is find the % of
ground balls at various distances across home plate.
I therefore need to 'bin' the two data sets I have - plate location for
ground balls
On Mar 13, 2011, at 12:18 AM, algotr8der wrote:
Thanks David for the reply. I just tried the following with the same
result:
library(tseries)
tickers - read.csv(testticker.txt, header=FALSE, sep=,)
tickers - tickers[1]
V1
1 XOM
2 COP
3 PBR-A
4 FFIV
5SU
6 PBR-B
tickers$V1 -
On Mar 12, 2011, at 11:35 PM, johnbeamer wrote:
Hello
I have a large series of data value -- effectivly say the point
across the
x-axis where a pitch crosses home plate. What I want to do is find
the % of
ground balls at various distances across home plate.
I therefore need to 'bin' the
Hi:
(1) The first argument to get.hist.quote() is instrument, not instruments. I
concur with David that get.hist.quote()
takes a single character string as an argument.
(2) I tried running this with lapply() but got a download error on the last
one:
getStockData(PBR-B)
trying URL '
On Mar 13, 2011, at 1:28 AM, Dennis Murphy wrote:
Hi:
(1) The first argument to get.hist.quote() is instrument, not
instruments. I
concur with David that get.hist.quote()
takes a single character string as an argument.
(2) I tried running this with lapply() but got a download error
Hi guys,
I got a problem when I was trying to use lattice to do some plot. Below is
one working example which can generate one curve for A and one curve for B
in each subplot. However, I would like to just show the points for B, not
connecting the dots. As for A, I still want a curve (dots are
70 matches
Mail list logo