On Mon, 5 Dec 2005, Kenneth Cabrera wrote:
Hi R users:
In your opinion and experience, which hardware configuration
is the best to run R over LINUX ?
With best I mean best performance,
and also cheapest. (about U$ 2.000 the whole basic system:
mother board+CPUs+RAM+HD)
I presume you
Hi R-Users,
I apologize if it is too simple question for all. I have a multivariate
dataset having 7 variables as independent and 1 dependent variable. 248
data points are there. I want to do out sample forecast first
considering 156 points. So I'll have to start from 157th point and
calculate
Renaud == Renaud Lancelot [EMAIL PROTECTED]
on Tue, 6 Dec 2005 08:09:35 +0100 writes:
Renaud For example:
vc - vcov(m1, useScale = FALSE)
b - fixef(m1)
se - sqrt(diag(vc))
z - b / sqrt(diag(vc))
P - 2 * (1 - pnorm(abs(z)))
cbind(b, se, z, P)
Dear all,
I like to extract row names column names from the named matrix..
like..
a-matrix(1:6,2)
ro-c(aa,bb)
co-c(dd,ee,ff)
dimnames(a)-list(ro,co)
a
dd ee ff
aa 1 3 5
bb 2 4 6
from the above matrix a
I like to extract
rownames separately like
Hi All,
This may be trivial in R but I have been trying with
out any success. I have a list of 100 elements each
having a sub list of different length. I would like to
write the list to a ASCII file. I tried with
write.table(), after converting my list to a matrix.
Now it looks like
Robert
I am trying to plot a figure within a figure (an inset that shows a closeup of
part of the data set). I have searched R-help and other sources but not found a
solution.
What I would like to do is
(1) produce a plot
(2) specify a window that will be used for the next plot (in inches or using the
Hi,
If I am ploting a world map like
plot (lon,lat)
then how to draw a continent boundry in that
plot.
What is the command...
Many thanks
Regards,
Yogesh
--
===
Yogesh K. Tiwari,
Max-Planck Institute for Biogeochemistry,
Hans-Knoell Strasse 10,
Dear all,
While running a function I´m getting only the final output of the function.
Bit if I like to store or recover some values that are intermediate in the
function calculations which command I have to use for storing those values.
hope u understand.
for
[EMAIL PROTECTED] wrote:
I am trying to plot a figure within a figure (an inset that shows a closeup of
part of the data set). I have searched R-help and other sources but not found
a
solution.
See the examples on the grid package by Paul Murrel in R News.
Uwe Ligges
What I would like
Hello everyone
My name is Vangelis and I want to ask a question about partial
correlation. I have used the command pcor.shrink to evaluate the
partial correlations of a data.frame but the problem is that in the
output results I cannot see whether these correlations are significant
or not. Is
You mean somthing like the following?
cat(();cat(rownames(a),sep=,);cat())
cat(();cat(colnames(a),sep=,);cat())
Best regrads,
Kristel
shanmuha boopathy wrote:
Dear all,
I like to extract row names column names from the named matrix..
like..
a-matrix(1:6,2)
as.numeric?
E.g.
R res
[1] 90 50 30
R as.numeric(res)
[1] 90 50 30
A Ezhil wrote:
Hi All,
This may be trivial in R but I have been trying with
out any success. I have a list of 100 elements each
having a sub list of different length. I would like to
write the list to a ASCII file. I
Yogesh K. Tiwari wrote:
Hi,
If I am ploting a world map like
plot (lon,lat)
then how to draw a continent boundry in that
plot.
What is the command...
See, e.g., the packages maps, mapdata, and mapproj as well as the
task view Spatial on CRAN.
Uwe Ligges
Many thanks
shanmuha boopathy a écrit :
a-matrix(1:6,2)
ro-c(aa,bb)
co-c(dd,ee,ff)
dimnames(a)-list(ro,co)
(Not sure I fully understand the question), but :
rn = rownames(a);
cn = colnames(a);
__
R-help@stat.math.ethz.ch mailing list
shanmuha boopathy a écrit :
a-function(a,b,c,d)
{
k=a+b
l=c+d
m=k+l
}
in this example the function will return only the value of m
...But I like to extract the values of l k also.
which command to use for storing or for extracting those intermediate
maybe the function pcor.confint() from package 'GeneNT' could be of
help.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Have you looked in the maps package?
Yogesh K. Tiwari wrote:
Hi,
If I am ploting a world map like
plot (lon,lat)
then how to draw a continent boundry in that
plot.
What is the command...
Many thanks
Regards,
Yogesh
__
Hello,
Being new to R, I am completely stuck with the following problem. Please
help to find a general solution to the following matrix task:
Given:
N-4
input_mat-matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
Hello everyone
I tried to install the library GeneNT in order to use the command
pcor.confint because I want to construct confidence intervals for
partial correlations but among other demanding the specific library
needs the library Graph which I don't have it and I cannot find it at
this
vincent == vincent [EMAIL PROTECTED]
on Tue, 06 Dec 2005 11:09:36 +0100 writes:
vincent shanmuha boopathy a écrit :
a-function(a,b,c,d)
{
k=a+b
l=c+d
m=k+l
}
in this example the function will return only the value of m
...But I like to
Here is one possible solution:
for(cr in seq(1, dim(combin_mat)[2])) {
W = which(input_mat[,combin_mat[1,cr]] == 1
input_mat[,combin_mat[2,cr]] == 1)
cat(Combination, cr, (, combin_mat[,cr], ) :, W, \n)
}
JeeBee.
---
Full program:
N = 4
input_numbers = seq((2^N)-1, 0, -1)
#
Vangelis == Vangelis Panagiotaras [EMAIL PROTECTED]
on Tue, 6 Dec 2005 13:39:33 +0200 writes:
Vangelis Hello everyone
Vangelis I tried to install the library GeneNT in order to use the command
Vangelis pcor.confint because I want to construct confidence intervals for
On Tue, 2005-12-06 at 13:43 +0100, Martin Maechler wrote:
vincent == vincent [EMAIL PROTECTED]
on Tue, 06 Dec 2005 11:09:36 +0100 writes:
vincent shanmuha boopathy a écrit :
a-function(a,b,c,d)
{
k=a+b
l=c+d
m=k+l
}
in this example
Martin Maechler wrote:
vincent == vincent [EMAIL PROTECTED]
on Tue, 06 Dec 2005 11:09:36 +0100 writes:
vincent shanmuha boopathy a écrit :
a-function(a,b,c,d)
{
k=a+b
l=c+d
m=k+l
}
in this example the function will return only the
Yes, it drives me mad too when people use = instead of - for
assignment and suppress spaces in an naive attempt for saving space.
As an example compare
o=fn(x=1,y=10,z=1)
with
o - fn( x=1, y=10, z=1 )
Regards, Adai
On Tue, 2005-12-06 at 13:43 +0100, Martin
Hi
Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004.
Rings, circles and null-models for point pattern analysis in ecology.
Oikos 104: 209-229 a statistic he called O-Ring statistic which is
similar to Ripley's K, only that it uses rings instead of circles.
Dear List,
I have two data.frame of the following form:
A:
n V1 V2
1 12 0
2 10 8
3 3 8
4 8 4
6 7 3
7 12 0
8 1 0
9 18 0
10 1 0
13 2 0
B:
n V1 V2
1 0 2
2 0 3
3 1 9
4 12 8
5 2 9
6 2 9
8 2 0
10 4 1
11 7 1
12 0 1
Now I want to merge
Hi All,
This may be trivial in R but I have been trying with
out any success. I have a list of 100 elements each
having a sub list of different length. I would like to
write the list to a ASCII file. I tried with
write.table(), after converting my list to a matrix.
Now it looks like
Robert
[Q.] How to create an array of lists, or structures the most elegant way?
There have been questions in the past but none too recently...I want to know
if the following looks OK to you guys or if there is a better way to create an
array of lists:
# PREAMBLE ... JUST TO GET THINGS
Hello R Users,
I have two sets of values
x - c(7, 7 , 8, 9, 15, 17, 18)
y - c(7, 8, 9, 15, 17, 19, 20, 20, 25, 23, 22)
I am able to create multi histogram using
multhist(). But not able to control the 'xlim'.
ie the xaxis is showing 7.5, 13, 18, 23
1st on what basis it is calculated
2nd I
I have very large csv files (up to 1GB each of ASCII text). I'd like to be able
to read them directly in to R. The problem I am having is with the variable
length of the data in each record.
Here's a (simplified) example:
$ cat foo.csv
Name,Start Month,Data
On 12/6/05, John McHenry [EMAIL PROTECTED] wrote:
[Q.] How to create an array of lists, or structures the most elegant way?
There have been questions in the past but none too recently...I want to know
if the following looks OK to you guys or if there is a better way to create
an array of
On Tue, 2005-12-06 at 14:22 +0100, Dubravko Dolic wrote:
Dear List,
I have two data.frame of the following form:
A:
n V1 V2
1 12 0
2 10 8
3 3 8
4 8 4
6 7 3
7 12 0
8 1 0
9 18 0
10 1 0
13 2 0
B:
n V1 V2
1 0 2
2 0 3
3 1 9
4 12
Martin Maechler a écrit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
but I'll be happy already if you could
drop these ugly empty statements at the end of your lines...
May I disagree ?
I find missing ; at end of lines *so* ugly.
Ugly/not ugly
Hi all,
the moment you hit the 'send' button you know the answer...
I approached a solution similar to this one given by Marc. But maybe there is a
better one? Even because this operation is done in a for-loop during which R
gets new data from a database. So I sum up 16 data.frames eventually.
By the way, does anybody knows if there is a R tidy or some similar
project to automatically reformat (and possibly check) R code, beside
what Emacs does?
See the appropriate section in `Writing R Extensions' (3.1 `Tidying R
code').
--
Brian D. Ripley, [EMAIL PROTECTED]
Hi all,
I am trying to build a package in R (ver 2.1.0, on a
PC). I am able to run package.skeleton successfully
and populate the different environments.
However, when I attempt to invoke the build (R CMD
BUILD), i get an error which says something like
protect(): Stack Overflow
I would
m1 - cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2),
v2=c(0,8,8,4,3,0,0,0,0,0) )
m2 - cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0),
v2=c(2,3,9,8,9,9,0,1,1,1) )
m.all - merge(m1, m2, by=n, all=T)
n v1.x v2.x v1.y v2.y
1) R-help mailing list is run entirely by volunteers, so requests such
as urgent may sound rude
2) Use an informative subject line please !
3) Please state which package multhist comes from.
4) Please show your call to multhist.
5) multhist does _histograms_ by aggregating points within
I consistently use ; at every end of my R code and have found it much more
neat than those sentences without an end; for - and =, if I were the
author I would rather take the first representation as a sign of
passing-by-reference while the latter by value.
Xiaofan Li
DAMTP, University of
Use file() connection in conjunction with readLines() and strsplit() should
do it. I would try to count the number of lines in the file first, and
create a list with that many components, then fill it in. I believe the
array of cells in Matlab is sort of equivalent to a list in R, but that's
=== 2005-12-06 22:16:17 您在来信中写道:===
Martin Maechler a �crit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
but I'll be happy already if you could
drop these ugly empty statements at the end of your lines...
May I disagree ?
I find missing ;
On Tue, Dec 06, 2005 at 03:16:17PM +0100, [EMAIL PROTECTED] wrote:
Martin Maechler a ?crit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
but I'll be happy already if you could
drop these ugly empty statements at the end of your lines...
I should have mentioned that I already tried the readLines() approach:
ta-readLines(foo.csv)
ptm-proc.time()
f-character(length(ta))
for (k in 2:length(ta)) { f[k-1]-(strsplit(ta[k],,)[[1]])[3] }# - PARSING
EACH LINE AT THIS LEVEL IS WHERE THE REAL INEFFICIENCY IS
(proc.time()-ptm)[3]
[1]
[EMAIL PROTECTED] wrote:
Martin Maechler a écrit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
but I'll be happy already if you could
drop these ugly empty statements at the end of your lines...
May I disagree ?
I find missing ; at end of
I don't have an answer to your query, but I do have
three suggestions:
1. Use a sensible subject line. This may be urgent to
you, but I doubt that it is to anyone else.
2. Do indicate what package contains multhist(). I have
no idea (nor do I know what a 'multi histogram' is).
3. Don't send
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges
Sent: Tuesday, December 06, 2005 1:54 AM
To: [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] figure with inset
[EMAIL PROTECTED] wrote:
I am trying to plot a figure
While mucking about with semicolons and line endings I wrote this little
piece of mildly obfuscated R code:
f1=function(n){
x = 1
---
n
return(x)
}
[best viewed with a proportionally-spaced font]
f1(1) does indeed return 1/1.
Baz
On Tue, 2005-12-06 at 15:19 +0100, Dubravko Dolic wrote:
Hi all,
the moment you hit the 'send' button you know the answer...
I approached a solution similar to this one given by Marc. But maybe
there is a better one? Even because this operation is done in a
for-loop during which R gets
I don't put in extraneous ';' because I maybe get a
blister on my little finger.
I suspect that those who find the semi-colons ugly in
R do not find them ugly in C. I think the reason there
would be a visceral reaction in R but not in C is that
there is a danger when using them in R that they
Jan T. Kim wrote:
There is a draft R Coding Convention available at
http://www.maths.lth.se/help/R/RCC/
which may be useful for finding a style that is good because it is
widely used and therefore familiar to a large number of readers.--
However, as the author Henrik Bengtsson
manohar == manohar [EMAIL PROTECTED]
on Tue, 6 Dec 2005 06:39:27 -0800 (PST) writes:
manohar Hi all,
manohar I am trying to build a package in R (ver 2.1.0, on a
manohar PC).
which I interpret that you are running Windows, right?
manohar I am able to run package.skeleton
Your first question seems relatively simple:
data.fall-subset(data,semester=='fall')
data.spring-subset(data,semester=='spring')
data.summer-subset(data,semester=='summer')
plot(x=year,y=value1,data=data.fall)
lines(x=year,y=value1,data=data.spring)
lines(x=year,y=value1,data=data.summer)
As
Dear altogether,
I tried local regression with the following data. These data are a part
of a bigger dataset for which loess is no problem.
However, the plot shows extreme values and by looking into the fits, it
reveals very extreme values (up to 2 !) although the original data are
Hello,
I'm a new user...
I have a function :
calculate - function(x,y)
{
z - x + y
}
I would like to use the result (z) with another function :
recalculate - function(...)
{
a - z^2
}
But R says that z does not exist...
How can I use z in an another function ?
Thank you
Barry Rowlingson [EMAIL PROTECTED] writes:
While mucking about with semicolons and line endings I wrote this little
piece of mildly obfuscated R code:
f1=function(n){
x = 1
---
n
return(x)
}
[best viewed with a proportionally-spaced font]
f1(1) does
P == P Ehlers [EMAIL PROTECTED]
on Tue, 06 Dec 2005 08:35:07 -0700 writes:
P [EMAIL PROTECTED] wrote:
Martin Maechler a écrit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
but I'll be happy already if you
I don't think this is C stack overflow. His R is so old the message means
`protection stack overflow'.
The first action (as described in the posting guide) is indeed to update
R, though.
On Tue, 6 Dec 2005, Martin Maechler wrote:
manohar == manohar [EMAIL PROTECTED]
on Tue, 6 Dec 2005
Dear R users,
I have a question regarding the use of xyplot in the lattice() package.
I have two factors (each with two levels), and I´d like to change the
order of the panels in a 2x2 panel layout from the default alphabetic
order that R uses based on the names of the factor levels.
My
First of all, you might try reading the manual.
Second, you might try something like this:
calculate - function(x,y)
{
z - x + yz
}
recalculate(z)
{
a - z^2
a
}
z - calculate(x, y)
recalculate(z)
You need to return some value from your functions,
and you need to assign that
Thank you for your answer.
And what if my first function gives 2 results :
calculate - function(x,y)
{
a - x + y
b - x - y
}
How can I use both a and b in a new function ?
2005/12/6, Sarah Goslee [EMAIL PROTECTED]:
First of all, you might try reading the manual.
Second, you
Her you just make the functions.
R calculate - function(x,y){z - x + y}
R recalculate - function(z){a - z^2}
You should run the functions, by take z as output for the first function
ans z as input for the next function:
R calculate - function(x,y){z - x + y}
R recalculate - function(z){a - z^2}
On Tue, 2005-12-06 at 18:09 +0100, Leo Gürtler wrote:
Dear altogether,
snip
# here is the difference!!
predict(mod, data.frame(x=X), se=TRUE)
predict(mod, x=X, se=TRUE)
--- end of snip ---
I assume this has some reason but I do not understand this reason.
Merci,
Not sure if this is
Could you time these and see how each of these do:
# 1
ta.split - strsplit(ta, split = ,)
ta.num - lapply(ta.split, function(x) as.numeric(x[-(1:2)]))
# 2
ta0 - sub(^[^,]*,[^.]*,, , ta)
ta.num - lapply(ta0, scan, sep = ,)
# 3 - loop version of #1
n - length(ta)
ta.split - strsplit(ta, split =
calculate - function(x,y)
{
a - x + yb - x - y
list(a=a, b=b)
}
myresult - calculate(x, y)
myresult$a
myresult$b
Please at least read the Introduction to R at
http://www.r-project.org/
It covers all of this very basic material.
Sarah
--
Sarah Goslee
http://www.stringpage.com
David Hajage wrote:
Hello,
I'm a new user...
I have a function :
calculate - function(x,y)
{
z - x + y
# insert:
z
}
I would like to use the result (z) with another function :
recalculate - function(...)
{
a - z^2
# insert:
a
}
Type:
Peter Dalgaard wrote:
It doesn't calculate it though... ;-)
My previous example is a bit ugly - this one looks nicer:
f1=function(n){
-1
x = ---
n
return(x)
}
And it returns f(1) as -1/1 and f(-1) as -1/-1 as well.
__
From: Martin Maechler
P == P Ehlers [EMAIL PROTECTED]
on Tue, 06 Dec 2005 08:35:07 -0700 writes:
P [EMAIL PROTECTED] wrote:
Martin Maechler a écrit :
please, please, these trailing ; are *so* ugly.
This is GNU S, not C (or matlab) !
On 06-Dec-05 John McHenry wrote:
I have very large csv files (up to 1GB each of ASCII text). I'd like to
be able to read them directly in to R. The problem I am having is with
the variable length of the data in each record.
Here's a (simplified) example:
$ cat foo.csv
I consistently use ; at every end of my R code and have found it much more
neat than those sentences without an end; for - and =, if I were the
author I would rather take the first representation as a sign of
passing-by-reference while the latter by value.
Xiaofan
-Original Message-
Thanks for the awk scripts, Ted. There are reasons (read political!) why R
needs to be able to read the files in directly. But, sure, I agree, why not
just awk the durned thing.
Just to be clear: the NAs aren't so much unsightly as the storage required in
RAM is too much. With 1GB files
Hi all:
I am using the R function step to perform a model selection in backward
direction. I'd like to automatically keep the dropped term at each step. So
I wrote a filter function for the keep argument. However, the filter
function cannot change the value of external variable and so doesn't
On 06-Dec-05 David Hajage wrote:
Hello,
I'm a new user...
I have a function :
calculate - function(x,y)
{
z - x + y
}
I would like to use the result (z) with another function :
recalculate - function(...)
{
a - z^2
}
But R says that z does not exist...
Hi,
Found no measure of association or correlation for 2x2 contingency tables in
fullrefman.pdf or google. Can someone point to a package that implements such
calculations?
Thanx.
--
Alexandre Santos Aguiar
- consultoria para pesquisa em saúde -
R Botucatu, 591 cj 81
Return something that can hold more than one value, eg:
calculate - function(x, y) {
list(a=x+y, b=x-y)
}
David Hajage wrote:
Thank you for your answer.
And what if my first function gives 2 results :
calculate - function(x,y)
{
a - x + y
b - x - y
}
How can I use
ronggui a écrit :
I think it is NOT just for historical reason.
see the following example:
rm(x)
mean(x=1:10)
[1] 5.5
x
Error: object x not found
x is an argument local to mean(),
did you expect another answer ?
mean(x-1:10)
[1] 5.5
x
[1] 1 2 3 4 5 6 7 8 9 10
What is the goal
On 06-Dec-05 Martin Maechler wrote:
[But really, I'm more concerned and quite bit disappointed by
the diehard ; lovers]
Martin Maechler
Well, while not die-hard, I will put in my own little reason
for often using ; at the end of lines which don't need them.
Basically, this is done to
Patrick Burns a écrit :
We get questions on R-help often enough about why
code like:
if(x 0) y - 4
else y - 4.5e23
doesn't work.
If people habitually used semi-colons, those sorts of
questions would probably multiply.
I wrote end of line in my first message,
but in fact I did mean
Here's a solution that uses aggregate(), as suggested in the subject of this
thread.
m1 - cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2),
v2=c(0,8,8,4,3,0,0,0,0,0) )
m2 - cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0),
Xiaofan Li wrote:
I consistently use ; at every end of my R code and have found it much more
neat than those sentences without an end; for - and =, if I were the
author I would rather take the first representation as a sign of
passing-by-reference while the latter by value.
The problem with
Happy Holidays!
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to
announce 2-day R/S-plus Fundamentals and Programming
Techniques in : www.xlsolutions-corp.com/Rfund.htm
***Seattle --
January 9th - 10th, 2006
***San
Happy Holidays!
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to
announce 2-day R/S-plus Fundamentals and Programming
Techniques in : www.xlsolutions-corp.com/Rfund.htm
***Seattle --
January 9th - 10th, 2006
***San
What is a simple way to convert a factor into a matrix of dummy variables?
fm-lm(y~f)
where f is a factor takes care of this in the estimation. I'd like to
save the result of expanding f into a matrix for later use.
Thanks.
Charles
--
Charles H. Franklin
Professor, Political Science
Everything has slowed down with #1 and #3 by about 50%. Can't do #2 #4 :
ta.num - lapply(ta0, scan, sep = ,)
Error in file(file, r) : unable to open connection
scan seems to want a file or a connection ...
Gabor Grothendieck [EMAIL PROTECTED] wrote:
Could you time these and see
The CoCo bundle might contain various measures of association...
Søren
Fra: [EMAIL PROTECTED] på vegne af Alexandre Santos Aguiar
Sendt: ti 06-12-2005 19:48
Til: r-help
Emne: [R] Coefficient of association for 2x2 contingency tables
Hi,
Found no measure of
On 12/6/05, Christoph Scherber [EMAIL PROTECTED] wrote:
Dear R users,
I have a question regarding the use of xyplot in the lattice() package.
I have two factors (each with two levels), and I´d like to change the
order of the panels in a 2x2 panel layout from the default alphabetic
order that
Hi,
I would like to construct a transition matrix from a data frame with
annual transitions of marked plants.
plant-c(1:6)
class-c(seed,seed, seed, veg, rep, rep)
fate-c(dead, veg,veg,rep, rep, veg)
trans-data.frame(plant, class, fate)
plant class fate
1 1 seed dead
2 2 seed veg
Here is a function I use to send lists to ASCII files.
list2ascii - function(x,file=paste(deparse(substitute(x)),.txt,sep=))
{
# MHP July 7, 2004
# R or S function to write an R list to an ASCII file.
# This can be used to create files for those who want to use
# a spreadsheet or
On Tue, 2005-12-06 at 16:48 -0200, Alexandre Santos Aguiar wrote:
Hi,
Found no measure of association or correlation for 2x2 contingency tables in
fullrefman.pdf or google. Can someone point to a package that implements such
calculations?
Thanx.
Alexandre,
See the assocstats()
Thanks for all your help.
For documentation (I'm probably not the last one searching R-help for a solution
to this problem), here is what I believe works best for the intended purouse:
x-0:10;
y-x^4;
library(gridBase)
X11(width=8,height=8)
# produce outer (main) plot
plot(x,y,xaxs=i,yaxs=i)
From: [EMAIL PROTECTED]
ronggui a écrit :
I think it is NOT just for historical reason.
see the following example:
rm(x)
mean(x=1:10)
[1] 5.5
x
Error: object x not found
x is an argument local to mean(),
did you expect another answer ?
mean(x-1:10)
[1] 5.5
x
[1] 1
On 12/2/05, Jason Miller [EMAIL PROTECTED] wrote:
Read R-helpers,
I'm relatively new to R and trying to jump in feet first. I've been
able to learn a lot from on-line and printed documentation, but
here's one question to which I can't find an answer. Well, it's a
question with a couple
See ?model.matrix.
HTH,
Andy
From: Charles H. Franklin
What is a simple way to convert a factor into a matrix of
dummy variables?
fm-lm(y~f)
where f is a factor takes care of this in the estimation. I'd like to
save the result of expanding f into a matrix for later use.
Thanks.
On 12/6/05, Ted Harding [EMAIL PROTECTED] wrote:
On 06-Dec-05 Martin Maechler wrote:
[But really, I'm more concerned and quite bit disappointed by
the diehard ; lovers]
Martin Maechler
Well, while not die-hard, I will put in my own little reason
for often using ; at the end of lines
A slight variation on one of Gabor's idea might work:
## simulate a data file:
n - 2e5
minF - 20
maxF - 30
f - file(test.csv, open=w)
invisible(replicate(n, writeLines(paste(runif(sample(minF:maxF, 1)),
collapse=,), f)))
close(f)
f - file(test.csv,
Dear Charles,
Try model.matrix(~f)[,-1].
Regards,
John
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox
-Original Message-
On 06-Dec-05 Deepayan Sarkar wrote:
[...]
The greater readability of the first relative to the second is
obvious. The compactness of the second relative to the first
is evident. Obtaining the second from the first by repeated J
is very quick.
I'm curious: exactly what purpose does this
Charles H. Franklin wrote:
What is a simple way to convert a factor into a matrix of dummy variables?
fm-lm(y~f)
model.matrix(y~f)
Uwe Ligges
where f is a factor takes care of this in the estimation. I'd like to
save the result of expanding f into a matrix for later use.
Thanks.
Gavin Simpson wrote:
Dear list,
I am very sorry for being inaccurate in my question. But re-reading the
predict.loess help site does not provide a solution. As long as predict
is used on a new dataset based on this dataset, the strange values
remain and can be reproduced.
Adding a new element
But note: There are (almost?) no situations in R where the dummy variables
coding is needed. The coding is (almost?) always handled properly by the
modeling functions themselves.
Question: Can someone provide a straightforward example where the dummy
variable coding **is** explicitly needed?
--
1 - 100 of 122 matches
Mail list logo