There is a *manual* on R Data Import/Export, not just an FAQ.
This is the first request I have seen for .ods (whatever that is -- please
don't assume that a file type is determined by an extension, and we not
infrequently get asked about CSV files with extension .xls).
On Thu, 1 May 2008,
My problem in a few words is as folow:
I used the fCopulae packages because i have 2 series which are already
transformed in the uniform domain (the space of the copulas functions) and i
estimated with type archmList() from 1 to 22, but i don't know their names:for
exemple the type=4 is the
The bug is in grid, in some layout calculations which need the string
width. There was a 'FIXME' in the sources, and I've fixed this now. (svn
r45579/80). Many other grid examples worked so it took me a while to
track this down.
On Thu, 1 May 2008, Dieter Menne wrote:
With 2.7.0 patched
Mike Dugas mikedugas77 at gmail.com writes:
Thanks for the help. I tried out the one promising lead, curfit.free.knot,
and it doesn't work for linear or quadratic splines. The documentation says
it should, but when I specify a linear spline, it returns a cubic.
Could you demonstrate this
No idea, can you make the package available for us (after R CMD build)?
Uwe Ligges
Vidhu Choudhary wrote:
Hi All,
I am trying to make R package using R 2.6.2
And I am getting following error.
When I give R CMD check t1\
-- Making package t1
adding build stamp to
I'm trying to drop all rows except for the ones with the most recent year.
So I split the data frame by NPERMNO and keep just the last record of all
groups.
datg=t(sapply(split(datgic, datgic$NPERMNO, drop=TRUE), function(x){return(
x[nrow(x),] )}))
I get something like this...
GVKEY
Thanks Greg,
I'll give it a whirl and let you know how it goes (although it might not
be till after the bank holiday weekend now sorry for delay!)
Thanks for replying and spending time on this problem.
All the best,
Jenny
On Thu, 1 May 2008, Greg Snow wrote:
Does the following do what
Hi, I have a problem regarding matrix handeling. I am working with a serie of
matrixes containing several columns. Now I would like to delete those rows of
the matrixes,that in one of the columns contain values less than 50 or greater
than 1000. How would this be possible, I have tried to
datg=t(sapply(split(datgic, datgic$NPERMNO, drop=TRUE),
function(x){return(
x[nrow(x),] )}))
I get something like this...
GVKEY NPERMNO GIC year
10001 12994 10001 55102010 2007
10002 19049 10002 40101015 2007
10009 16739 10009 40101010 1999
Has this been made
I have installed R 2.7.0 in a Linux x64 computer and everything seems to be
ok but, when I am trying to plot something, say plot(x=1:10), I am getting
the following message:
unable to load shared library '/usr/local/lib/R/modules//R_X11.so
...(and libpangocairo-1.0.so.0, as well)...
If I use
If I have this daily rainfall data, how do call a particular day?
Year,Month,Day,Amount
1900,12,22,1.3
1900,12,23,0
1900,12,24,0
1900,12,25,0
1900,12,26,0
1900,12,27,0
1900,12,28,0
1900,12,29,4.8
1900,12,30,0.3
1900,12,31,0.5
1901,1,1,0
1901,1,2,3
1901,1,3,0
1901,1,4,0.5
I too have been studying the book and it is indeed outstanding.
For my purposes the only topic missing is the straightforward drawing
of error bars and bands, for which I've been using Hmisc::xYplot
(where error bands seem to be broken for R) or gplots::barplot2.
_
Hi,
Im having trouble creating the following graph. Here is my code:
library(plotrix)
library(prettyR)
female_improvement
-read.table(C://project/graphs/gender/breakdown/gender-improvement/female-improvement.csv,
sep=,, header=TRUE)
Michael Kubovy wrote:
I too have been studying the book and it is indeed outstanding.
For my purposes the only topic missing is the straightforward drawing
of error bars and bands, for which I've been using Hmisc::xYplot
(where error bands seem to be broken for R) or gplots::barplot2.
If
Hi, I have a problem regarding matrix handeling. I am working with
a serie of matrixes containing several columns. Now I would like to
delete those rows of the matrixes,that in one of the columns contain
values less than 50 or greater than 1000.
Try this:
m - matrix(runif(150, 0, 1050),
Hi,
I am having trouble plotting a series of dendrograms using lattice and grid
code as found in Paul Murrells book R Graphics.
This is the error message I recieve:
Error in downViewport.vpPath(vpPathDirect(name), strict, recording =
recording) :
Viewport 'plot1.panel.1.1.off.vp' was not
It appears that you have a problem in your data. Here is just the
rbind in the call:
rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]])
Info entered is all relevant Room for improvement Room for Improvement
[1,] 20
Have a look at the zoo package which has three vignettes and R News 4/1.
On Fri, May 2, 2008 at 12:27 AM, Roslina Zakaria [EMAIL PROTECTED] wrote:
Hi R-expert,
If I have this daily rainfall data, how do call a particular day?
Year,Month,Day,Amount
1900,12,22,1.3
1900,12,23,0
1900,12,24,0
Hi,
I user barplot2 to make a plot bar with errors bars. In old times I needed to
use a sequence of segments commands to make this.
Now I try to make the same but using lattice. Is possible to use barplot2 in
barchart function?
If not, what is the simplest way to put errors bar in barchart? I
Hi,
I am using the stdFit function (fGarch package) to get estimates for a
fitted location, scale, and degrees of freedom of a dataset. I have no
errors with the code however the estimates are not identical to the
estimates I am getting when using SAS and MatLab (both give me the same
estimates).
Giovanni Petris GPetris at uark.edu writes:
## Example: Ratings of prime minister (Agresti, Table 12.1, p.494)
rating - matrix(c(794, 86, 150, 570), 2, 2)
dimnames(rating) - list(First = c(approve, disapprove),
+ Second = c(approve, disapprove))
rating
On
R version 2.7.0 (2008-04-22)
i386-apple-darwin8.10.1
locale:
C/C/en_US/C/C/C
attached base packages:
[1] splines grid grDevices datasets graphics stats
utils methods base
other attached packages:
[1] Design_2.1-1 survival_2.34-1 Hmisc_3.4-3
Dear list,
I would like to produce a plot of variables where the size of the points
will be indicative of their standard errors.
How is that possible?
Thank you!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
The help says
A data frame is split by row into data frames subsetted by the
values of one or more factors, and function 'FUN' is applied to
each subset in turn.
You attempting to apply median() to a data frame -- it does no work,
unlike mean()
On Fri, 2 May 2008, vito muggeo
I am writing a simple R program to execute a t-test repeatedly on data
contained in a data frame. My data looks like this:
Category Value1 Value2
1 .5 .8
1 .3
dear all,
Could anyone explain me the behaviour of median() within by()?
(I am running R.2.7.0)
thanks,
vito
H-cbind(rep(0:1,l=20),matrix(rnorm(20*2),20,2))
by(H[,-1],H[,1],mean)
INDICES: 0
V1 V2
-0.2101069 0.2954377
dear R-help:
one of my students is struggling to test an ordered alternative
hypothesis on a set of groups (e.g., mu_a = mu_b = mu_c).
There has been some literature on this topic -- a lot of
this goes back to Bartholomew (1961); Gaines and Rice
(see refs below) are the ones who've
Try:
foo - function(data, ...)
{
res - unlist(lapply(split(data, data$Category),
function(.x)t.test(.x$Value1, .x$Value2)$p.value))
test - merge(data, as.data.frame(res), by.x=Category, by.y = 0)
return(test)
}
x - data.frame(Category = rep(1:15, each = 10), Value1 = rnorm(150), Value2
=
Thank you, Bert!
I have a question one more. I have found out that mosaic function of
vcd package is more interesting since I want to color different cells.
The question is how to make x axis label to be vertical not
horizontal. I tried las or some other options in par but I could
not
Dear All,
I am trying to get ICC (Intra class correlation
coefficient) for a questionnaire. The questionnaire
has about 25 questions and was administered to 50
subjects on two occasions. I want to calculate the
reproducibility of the questionnaire administered to
the same group of subjects on two
I would like to learn how to parse a mixed text/xml document I
downloaded from the sec.gov website (see example below). I would like
to parse this to get the value for each xml tag and then access it
within R, but I don't know much about xml so I don't even know where to
start debugging the
Hi,
I like mosaic function of vcd package. I have played around it. I
have found out that mosaic plot data table is 2-dimension does not
stretch when you enlarge a mosaic plot. It is okay when data table is
3 or more dimension. The first one is of 3-dimension table case, and
the second
esmail bonakdarian [EMAIL PROTECTED] wrote:
Yes, I have been reading the list, the amount of messages per day
is simply amazing, I can hardly keep up. Do most of you read this
on the web or get it as digest? I am getting them as individual
e-mails (thank god for filters) ... :-)
I used
Hi David,
Try this:
# Data set
set.seed(123)
Category=as.factor(rep(1:15,each=10))
Value1 = rnorm(150)
Value2= rnorm(150)
yourdata=data.frame(Category,Value1,Value2)
# Global function
TTEST=function(mydata){
# Internal function
tt=function(x,y) t.test(x,y)$p.value
# p-values
for(i in
Hi Roger --
Bos, Roger [EMAIL PROTECTED] writes:
I would like to learn how to parse a mixed text/xml document I
downloaded from the sec.gov website (see example below). I would like
I'm not sure of a more robust way to extract the XML, but from
inspection I wrote
ftp -
This depends entirely one what the version in vcd allows you to do. Since I
don't use it, I have no idea. Read the docs there, or perhaps someone else
familiar with it can help.
-- Bert
-Original Message-
From: Sang Chul Choi [mailto:[EMAIL PROTECTED]
Sent: Friday, May 02, 2008 8:06 AM
On Fri, 2 May 2008, Sang Chul Choi wrote:
Hi,
I like mosaic function of vcd package. I have played around it. I
have found out that mosaic plot data table is 2-dimension does not
stretch when you enlarge a mosaic plot. It is okay when data table is
3 or more dimension. The first one is of
Sang Chul Choi choi at biology.rutgers.edu writes:
I like mosaic function of vcd package. I have played around it. I
have found out that mosaic plot data table is 2-dimension does not
stretch when you enlarge a mosaic plot. It is okay when data table is
3 or more dimension. The first
Hi, I have a question about reformatting data. It looks like it should
be simple, but I've been working at it for awhile now and it's about
time I ask for help.
My data look like this:
ITEM VALUE STEP
item1 A first
item2 C first
item2 D second
item1 A second
On Fri, May 2, 2008 at 11:05 AM, Matt [EMAIL PROTECTED] wrote:
Hi, I have a question about reformatting data. It looks like it should
be simple, but I've been working at it for awhile now and it's about
time I ask for help.
My data look like this:
ITEM VALUE STEP
item1 A
hi,
since lately i receive an error message when prompting ?help:
help will not be available. path not found. It is not possible to get help
for any command. I don`t know why but it seems that i need to tell R the
right path for the helpfiles. How can i do that?
thanks a lot
cheers
michael
Try this also:
noquote(with(x, tapply(VALUE, list(ITEM, STEP), paste)))
On Fri, May 2, 2008 at 1:05 PM, Matt [EMAIL PROTECTED] wrote:
Hi, I have a question about reformatting data. It looks like it should
be simple, but I've been working at it for awhile now and it's about
time I ask for
Thank you very much!
Sang Chul
On May 2, 2008, at 12:06 PM, Dieter Menne wrote:
Sang Chul Choi choi at biology.rutgers.edu writes:
I like mosaic function of vcd package. I have played around it. I
have found out that mosaic plot data table is 2-dimension does not
stretch when you enlarge a
Hi,
I want to have a horizontal line on a mosaic plot with vcd package.
This would give me an idea where is 0.5 proportion in a cell. Using
mosaicplot function of graphics package, I can draw a line using
abline. But, with mosaic function of vcd package, I have tried
to use abline
I want to use spplot inside a loop to itteratively produce png files.
for (i in 1:5){
png(file=paste(myPlot,i,.png,sep=),bg=white,height=500,width=500)
library(lattice)
trellis.par.set(sp.theme()) # sets bpy.colors() ramp
data(meuse)
coordinates(meuse) - ~x+y
l2 =
Is this what you are trying to do?
tt - matrix( 5:10, ncol=2 )
df - as.data.frame.table(tt)
df2 - df[ rep( 1:nrow(df), df$Freq ), ]
And is that elegant enough?
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
Dear all,
I am trying to estimate partial residuals for the multiple regression lm
model:
a.lm=lm(y~x1+x2)
I use the function
residuals(a.lm, type=partial)
However, the results are much different when I use the manual method
to get partial residuals for x2 (or for x1):
Sang Chul Choi Choi at biology.rutgers.edu writes:
I want to have a horizontal line on a mosaic plot with vcd package.
This would give me an idea where is 0.5 proportion in a cell. Using
mosaicplot function of graphics package, I can draw a line using
abline. But, with mosaic function
Hello. I am looking for a multiple comparisons test to follow up a
repeated mesures ANOVA i have conducted. Im not an expert in
statistics or in R but i have managed to produce this:
START
fit5.lme-lme(logfaa~segment,random=~+1|fish)
anova(fit5.lme)
numDF denDF F-value
Hello R-listers! My first post to the list is a very simple one for those
who use the software continuosly. I am trying to understand the fixed-x
resampling and random-x-resampling method proposed by Fox about
Bootstrapping. The doubt that I have is on the side of the model run in one
of the
Hello.
I'm trying to do this (not necessarily 0:1) :
expand.grid ( 0:1, 0:1, 0:1, 0:1, 0:1)
etc..etc.
but I want to have control over how many 0:1 are included.
Any ideas please ?
Thankyou.
Simon Parker
Imperial College
-
A Smarter Email.
Hello,
I'm attempting to load a ~110 MB text file with ~500,000 rows and 200
columns using read.table . R hangs and seems to give up. Can anyone tell me
an efficient way to load a file of this size?
Thank you!
Alex
--
View this message in context:
Hi!
I am using geeglm (in geepack) and I need to use weights. There is in R a
function that calculates the weights like in SAS PROC GENMOD . Any help would
be sincerely appreciated.
Thanks
Salomé
__
R-help@r-project.org mailing list
?do.call
On Fri, 2 May 2008, Simon Parker wrote:
Hello.
I'm trying to do this (not necessarily 0:1) :
expand.grid ( 0:1, 0:1, 0:1, 0:1, 0:1)
etc..etc.
but I want to have control over how many 0:1 are included.
Any ideas please ?
Thankyou.
Simon Parker
Imperial College
On 5/2/2008 2:13 PM, ajoyner wrote:
Hello,
I'm attempting to load a ~110 MB text file with ~500,000 rows and 200
columns using read.table . R hangs and seems to give up. Can anyone tell me
an efficient way to load a file of this size?
It will help a lot if you specify the column types (using
Hi Alex,
Perhaps
http://www.nabble.com/How-to-read-HUGE-data-sets--td15729830.html#a15746400can
helps.
HTH,
Jorge
On Fri, May 2, 2008 at 2:13 PM, ajoyner [EMAIL PROTECTED] wrote:
Hello,
I'm attempting to load a ~110 MB text file with ~500,000 rows and 200
columns using read.table . R
Hi folks!
How do I extract lags from a formula? An example:
mod.eq-formula(x~lag(x,-1)+lag(x,-2))
mod.eq
x ~ lag(x, -1) + lag(x, -2)
mod.eq[1]
~()
mod.eq[2]
x()
mod.eq[3]
lag(x, -1) + lag(x, -2)()
I'm trying to extract the lags into a vector that would be simply [1,2].
How
Try:
tmp - rep( list( 0:1 ), 5 )
out - do.call(expand.grid, tmp)
Then change the 5 to whatever you want.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
-Original Message-
From: [EMAIL
On Fri, May 2, 2008 at 1:35 PM, Kerpel, John [EMAIL PROTECTED] wrote:
Hi folks!
How do I extract lags from a formula? An example:
mod.eq-formula(x~lag(x,-1)+lag(x,-2))
mod.eq
x ~ lag(x, -1) + lag(x, -2)
mod.eq[1]
~()
mod.eq[2]
x()
mod.eq[3]
lag(x, -1) +
profr 0.1
profr provides an alternative data structure and display for profiling
data. It still uses Rprof() to collect the data, but outputs a
data.frame which should be easier to manipulate. It also implements a
novel visualisation which allows you to see the
you could do it using apply like the first two replies mentioned or you could
just use the index way
for example: (assuming your matrix name is ym and the values are greater
than 25 and less than 50 and the column is column 3).. if you mean any
column use the first two replies.
Hello R-listers! My first post to the list is a very simple one for
those who use the software continuosly. I am trying to understand the
fixed-x resampling and random-x-resampling method proposed by Fox
about Bootstrapping. The doubt that I have is on the side of the model
run in one of the
On 5/2/2008 2:52 PM, Alex Joyner wrote:
Duncan,
Thank you for your response. I actually am using colClasses, but the
first column is a character column, and the rest are numeric. Is there
any way to specify that all columns are numeric except for the first
one? I couldn't find this in the
Hi,
Is there a simple way to do correlation coefficient tests with
cor.test like I would do with cor function? I have a data frame
where each column is a list.
y - data.frame(a=sample(30, 20), b=sample(30, 20), c=sample(30,20))
cor(y)
Martin,
I can't thank you enough for taking the time to help and providing the
detailed examples of how to get started. Now I know exactly how to
proceed.
Thanks again,
Roger
-Original Message-
From: Martin Morgan [mailto:[EMAIL PROTECTED]
Sent: Friday, May 02, 2008 12:02 PM
To:
Hello:
I am using plot() in rpart, making a decision tree plot. I use plot() first,
then text() followed, but I think due to the figure vs. text size, the bottom
of the text always gets cut off. I can only see the text of the bottom of the
tree if I make the font size REALLY small.
I
Hello,
I posted a question yesterday but I got no replies, so I'll try to
reformulate it in a more concise way.
I have the following data, summarizing approval ratings on two
different surveys for a random sample of 1600 individuals:
## Example: Ratings of prime minister (Agresti, Table
Thank you, Dieter, very much for your answer.
I'd rather avoid using mosaic. I think that I need to read more about
vcd manual you mentioned. One quick question? Is it possible to
color each cells with all different colors with mosaicplot? I have
used mosaic function to do coloring each
Hi,
I am trying out a generalized least squares method of forecasting that
corrects for autocorrelation. I downloaded daily stock data from Yahoo
Finance, and am trying to predict Close (n=7903). I have learned to use
date functions to extract indicator variables for Monday - Friday (and
Friday
Hello:
I am using plot() in rpart, making a decision tree plot. I use plot()
first, then text() followed, but I think due to the figure vs. text
size, the bottom of the text always gets cut off. I can only see the
text of the bottom of the tree if I make the font size REALLY small.
I
Hi,
After updating to R 2.7, my .Rprofile executes twice on startup. I
confirmed this by putting in the following line:
print(starting .Rprofile...)
When I start R, I see:
[1] starting .Rprofile...
[1] starting .Rprofile...
This seems like the obverse of the following FAQ:
Try this:
y - data.frame(a=sample(30, 20), b=sample(30, 20), c=sample(30,20))
x - diag(1, length(names(y))
cors - combn(names(y), 2,
FUN = function(x)cor.test(y[,x[1]], y[,x[2]])$p.value)
x[lower.tri(x)] - cors
x[upper.tri(x)] - cors
On 5/2/08, Sang Chul Choi [EMAIL PROTECTED]
You're running out of RAM. Your options are
1) run code on a machine with more RAM
2) try the model on fewer observations
3) try a simpler model.
Andrew
On Fri, May 02, 2008 at 12:37:15PM -0700, zerfetzen wrote:
Hi,
I am trying out a generalized least squares method of forecasting that
On Fri, May 02, 2008 at 03:06:31PM -0500, Giovanni Petris wrote:
Hello,
I posted a question yesterday but I got no replies, so I'll try to
reformulate it in a more concise way.
I have the following data, summarizing approval ratings on two
different surveys for a random sample of 1600
On Sat, May 03, 2008 at 06:43:22AM +1000, Andrew Robinson wrote:
On Fri, May 02, 2008 at 03:06:31PM -0500, Giovanni Petris wrote:
Hello,
I posted a question yesterday but I got no replies, so I'll try to
reformulate it in a more concise way.
I have the following data,
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Irene Mantzouni
Sent: Friday, May 02, 2008 7:52 AM
To: [EMAIL PROTECTED]
Subject: [R] points size in plots
Dear list,
I would like to produce a plot of variables where the size of
the points will
Andrew,
Thank you for your reply. In fact, I had a way of unrolling the table
but I think yours look much nicer - much readable to me. Below is what
I did, but I was afraid I would scare my students away from R!
approval - factor(c(Approve, Disapprove),
+levels =
You need seet the FUN argument:
X - with( FDP0D, ave( IAC, list( Key), FUN = mean))
On 5/1/08, Chip Barnaby [EMAIL PROTECTED] wrote:
Henrique, thanks for the response. As a new
user, I was unaware of with() and ave(), those are both very helpful.
However, I don't think your method is quite
Dear all,
how can I, with R, transform a presence-absence (0/1) matrix of species
occurrences into a presence-only table (3 columns) with the names of the
species (1st column), the lat information of the sites (2nd column) and
the lon information of the sites (3rd column), as given in the
Hi,
I have data that is on a log base 2 scale. It goes from negative factors of
2 to positive ones. I am using barplot. However, I don't want the data
centered at 0 - I want the min of the yaxis to be just below the lowest
value in the data. The plots are kind of deceptive switching between
Christian,
You need to use reshape to convert to the 'long' format.
Check the help page ?reshape for details.
dat - read.table('clipboard', header=TRUE)
dat
site lat lon spec1 spec2 spec3 spec4
1 site1 10 11 1 0 1 0
2 site2 20 21 1 1 1 0
3 site3 30 31
Hi Christian,
Here's a way using the reshape package:
dfr
site lat lon spec1 spec2 spec3 spec4
1 site1 10 11 1 0 1 0
2 site2 20 21 1 1 1 0
3 site3 30 31 0 1 1 1
library(reshape)
dfr - melt(dfr[, -1], id=1:2, variable_name='species')
On 02/05/2008 4:24 PM, Dan Tenenbaum wrote:
Hi,
After updating to R 2.7, my .Rprofile executes twice on startup. I
confirmed this by putting in the following line:
print(starting .Rprofile...)
When I start R, I see:
[1] starting .Rprofile...
[1] starting .Rprofile...
This seems like the
Try this:
newx - with(x, cbind(stack(x, select = grep(spec, names(x))), lat, lon))
newx[newx$values 0, -1]
On 5/2/08, Christian Hof [EMAIL PROTECTED] wrote:
Dear all,
how can I, with R, transform a presence-absence (0/1) matrix of species
occurrences into a presence-only table (3 columns)
On 5/2/08, Michael Kubovy [EMAIL PROTECTED] wrote:
I too have been studying the book and it is indeed outstanding.
For my purposes the only topic missing is the straightforward drawing of
error bars and bands, for which I've been using Hmisc::xYplot (where error
bands seem to be broken for R)
On 5/2/08, Ronaldo Reis Junior [EMAIL PROTECTED] wrote:
Hi,
I user barplot2 to make a plot bar with errors bars. In old times I needed to
use a sequence of segments commands to make this.
Now I try to make the same but using lattice. Is possible to use barplot2 in
barchart function?
Hi David,
Putting a print statement around your spplot command solves your
problem. This behaviour is common for trellis graphics plot methods
(such as spplot). This is the command including print:
print(spplot(meuse, c(ffreq),
sp.layout=list(l2,l3,l4,l5),col.regions=black,pch=c(1,2,3),
Since we're on the topic of book reviews, I just received Phil Spector's
new R book called Data Manipulation with R and it is also quite a
nice book. I haven't gone through it all and I won't give a detailed
review but I have gotten a lot out of the first 100 pages that I have
read.
Note
I would like to create a 3d scatterplot that is interactive in the sense
that I can spin it on its axes to better visualize some PCA results I have.
What are the options in R? I've looked at RGL and perhaps it will suffice
but it wasn't apparent from the documentation I found.
Any demo scripts
On Sun, Apr 27, 2008 at 10:10 AM, David Winsemius
[EMAIL PROTECTED] wrote:
Nelson Castillo [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
(cut)
That is, from:
x
weight var1 var2
1 1AB
2 1AB
3 2AB
4 1AB
5
Dear R users,
I've had no joy finding a solution to this online or in any of my R books.
Many thanks in advance for any help you can give.
I'm seeking to output a data frame (or matrix - it doesn't matter which for
my purposes) to a .txt file, but omit any row or column names. The data
frame
try:
write.table(x, file=/Users/Desktop/Data.txt, row.names= FALSE, col.names=
FALSE, sep=, append=TRUE)
this should do it. If you don't want to append, just turn that opion off.
Stropharia wrote:
Dear R users,
I've had no joy finding a solution to this online or in any of my R books.
Hi Mark,
Try using ggobi via Rggobi. ggobi is aimed at higher dimension
multivariate data but it does a very useful service in 3-D projections,
do a manually controlled tour ... I've used this to tweak PCA results
and find fine structure,
Richard
Mark Kimpel wrote:
I would like to create
Steve,
I think you can use:
write.table(x, file = /Users/Desktop/Data.txt, sep = , append=T,
row.names = F, col.names = F)
I used that for the data
PERSHRUB DISTX AGE RODENTSP
166 2100 501
290 914 201
375 1676 341
475 243
If x is a zoo object note that zoo (and therefore dyn) allows the more compact
form lag(x, -(1:2)) so if we write:
mod.eq - x ~ lag(x, -(1:2))
then mod.eq[[3]][[3]] is the vector -(1:2) or if you like you can define
Lag - function(x, k) lag(x, -k) in which case you can write it:
mod.eq - x ~
Dear list:
I have a problem using the subset function:
dat- data.frame(treatment=c(A, B, A, C, C, D, A, D,
C, D), response=rnorm(10))
I am interested in treatments A, B and D
vec- c(A, B, D)
But I can only obtain what I want with:
subset(dat, treatment==A | treatment==B | treatment==D)
What's
Try %in%
subset(dat, treatment %in% vec)
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, May 02, 2008 11:41 PM
To: r-help@r-project.org
Subject: [R] help with subset
Dear list:
I have a problem using the
Justin,
try
subset(dat, treatment %in% vec)
I guess thats what you want.
On Fri, May 2, 2008 at 8:40 PM, [EMAIL PROTECTED] wrote:
Dear list:
I have a problem using the subset function:
dat- data.frame(treatment=c(A, B, A, C, C, D, A, D,
C, D), response=rnorm(10))
I am interested in
Thank you Christos and Jim:
That is precisely what I was after.
On Sat, 3 May 2008 00:01:58 -0400, Christos Hatzis
[EMAIL PROTECTED] said:
Try %in%
subset(dat, treatment %in% vec)
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL
#Install library rgl
#here is the is the function:
rgl.plot3d-function(z, x, y, cols=red,axes=T,new=T)
{xr-range(x)
x01-(x-xr[1])/(xr[2]-xr[1])
yr-range(y)
y01-(y-yr[1])/(yr[2]-yr[1])
zr-range(z)
z01-(z-zr[1])/(zr[2]-zr[1])
if(new) rgl.clear()
if(axes)
{xlab-pretty(x)
1 - 100 of 103 matches
Mail list logo