lavaan, sem, openMx all do this (there may be others)
hth, Ingmar
On Fri, Mar 11, 2011 at 8:26 AM, rvohen bingbingzhan...@126.com wrote:
In R software,does it have packages about confirmatory factor analysis in R
software? 3Q
--
View this message in context:
I had an obscure bug that boiled down to this ``feature'' in R,
Read 3921 items
A = list(aa = 1)
A
$aa
[1] 1
if (A$a) print(a is there)
[1] a is there
The test appear to check is A$a is TRUE, but what happen is that it
auto-complete (silently), and expand to 'A$aa'.
The problem was caused
Yes, it is intersect rather than intersection, sorry.
And in panel.text() the x and y were switched, so just reverse the
first two arguments.
Thats what comes from posting from an iGizmo with no R to test my code.
2011/3/11 Umesh Rosyara rosyar...@gmail.com:
Thank you so much for the advice.
Hi,
From ?$, you can see that using [[ instead would do what you're
looking for. You should read and try to understand the whole help file.
The reason is that for [[ the default is exact=TRUE, wheareas for $ the
only possible value is exact=FALSE, which means partial matching if
possible.
Hello R-helpers:
I have data like this:
samplereplicateheightweightage
A1.0012.00.646.00
A2.0012.20.386.00
A3.0012.40.496.00
B1.0012.70.654.00
B2.0012.80.785.00
C1.0011.90.456.00
C
Thanks Gabor, that worked great!
Gabor Grothendieck wrote:
On Thu, Mar 10, 2011 at 11:27 AM, mathijsdevaan
lt;mathijsdev...@gmail.comgt; wrote:
Hi,
I have a data.frame of the following type:
F = data.frame(read.table(textConnection( A B
1 1 4
2 1 3
3 1 1
4 1 4
5 1 2
6 1
On Mar 11, 2011, at 09:55 , Håvard Rue wrote:
since NULL elements are removed from the list, and that A$a auto-expand
to A$aa, my error appeared.
To me, this seems not a feature I want in order to have a robust
program.
Partial matching of arguments and list item names is a
use the package 'data.table'
x - read.table(textConnection(samplereplicateheightweightage
+ A1.0012.00.646.00
+ A2.0012.20.386.00
+ A3.0012.40.496.00
+ B1.0012.70.654.00
+ B2.0012.80.785.00
+ C
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi
I know there is a function - I have used it before - but I always forget
what it is called...
I need the combination of two character vectors, i.e:
x - c(a, b)
y - c(x, y)
z - THEFUNCTION(x, y)
z == c(ax, ay, bx, by)
I promise I will write
Dear r-helpers,
This might be an elementary question, but I have a hard time getting
my head around it, so all help is much appreciated.
I am working on a nonlinear regression model of the form
if z 0
y = f1(x,y),
else
y = f2(x,t) .
In other words, the functional form of f(.) changes
On 03/11/2011 05:08 AM, Mike Gibson wrote:
I want to increase the number of labels on my y-axis. Here is my code:
plot(fish$species, fish$fl, ylim=c(5,25), xlab=Species, ylab=Fork Length
(in))
The plot is great but it only has numerical y-labes every five values (i.e.
labels at 5, 10,
Aline Santos wrote:
Hello R-helpers:
I have data like this:
samplereplicateheightweightage
A1.0012.00.646.00
A2.0012.20.386.00
A3.0012.40.496.00
B1.0012.70.654.00
B2.0012.80.785.00
C
Hi:
Here are a few one-liners. Calling your data frame dd,
aggregate(cbind(height, weight, age) ~ sample, data = dd, FUN = mean)
sample heightweight age
1 A 12.2 0.503 6.00
2 B 12.75000 0.715 4.50
3 C 11.35250 0.5125000 3.75
4 D 14.99333
Hi:
This is probably not quite what you had in mind, but both work for your
example - I think the second is probably easier.
x - c(a, b)
y - c(x, y)
as.vector(outer(x, y, function(x, y) paste(x, y, sep = '')))
[1] ax bx ay by
apply(expand.grid(x, y), 1, paste, collapse = '')
[1] ax bx ay by
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 03/11/2011 12:22 PM, Dennis Murphy wrote:
Hi:
This is probably not quite what you had in mind,
No - the second one is the one I used before.
Thanks,
Rainer
but both work for your
example - I think the second is probably easier.
x -
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Dear List,
I have fitted a spherical function to my variogram using variofit(...)
from GeoR. Now I would like to predict some data with the function
predict(object,...) from package stats. Does anyone know wether this
works and if it does how to do it?
Thanks a lot!
Anna
Hi Rainer,
I don't know a function for literally substituting THEFUNCTION, but
x - c(a, b)
y - c(x, y)
sort(levels(interaction(x,y,sep=)))
or
as.vector(t(outer(x,y,paste,sep=)))
will work. sort and t respectively here are used to produce the
desired order.
hth.
Am 11.03.2011 11:53, schrieb
or even simpler
paste(rep(x,each=length(y)),y,sep=)
Am 11.03.2011 12:44, schrieb Eik Vettorazzi:
Hi Rainer,
I don't know a function for literally substituting THEFUNCTION, but
x - c(a, b)
y - c(x, y)
sort(levels(interaction(x,y,sep=)))
or
as.vector(t(outer(x,y,paste,sep=)))
will
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
Hello!
I've been trying to get this right for quite a while now and fear
there is an easy solution I just don't see. I did not have this
problem in Linux, and I searched r-help and Google
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 03/11/2011 12:48 PM, Eik Vettorazzi wrote:
or even simpler
paste(rep(x,each=length(y)),y,sep=)
I like that one - it makes perfect sense. I might wrap it into a
function and use it.
Am 11.03.2011 12:44, schrieb Eik Vettorazzi:
Hi Rainer,
Hi:
Perhaps something like
f1(x, y) * I(z 0) + f2(x, y) * I(z = 0) ??
HTH,
Dennis
On Fri, Mar 11, 2011 at 3:10 AM, Otto Kässi otto.ka...@gmail.com wrote:
Dear r-helpers,
This might be an elementary question, but I have a hard time getting
my head around it, so all help is much
H Zeileis,
This helped out a lot - thanks!!
Jen
--
View this message in context:
http://r.789695.n4.nabble.com/tobit-regression-model-tp3345789p3347936.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On Mar 10, 2011, at 8:23 AM, Benjamin Stier wrote:
Hello list!
I have a data.frame which looks like this:
serv
datum op.read op.write read write
1 2011-01-29 10:00:00 00 0 0
2 2011-01-29 10:00:01 00 0 0
3 2011-01-29 10:00:02
Thank you for helping me and this solved the problem
Best Regards
Umesh R
_
From: foolish.andr...@gmail.com [mailto:foolish.andr...@gmail.com] On Behalf
Of Felix Andrews
Sent: Friday, March 11, 2011 4:05 AM
To: Umesh Rosyara
Cc: R mailing list;
Can someone help with a fairly simple task?
I have a data set where I would like to insert a 0 time event between
individuals:
what I have:
VAR DATETIME CONC COVAR
1 NOV20.2510 group1
1 NOV20.5 20 group1
1 NOV21 5 group1
1
On Mar 10, 2011, at 3:58 PM, shai uliel wrote:
Dear R helpers
I have a table and i need to make new table
table1:
sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10
snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1
-1 -1
7765 1 1 1 0 0 0 -1 1 1 1 0 0
Try this:
newX - rbind(unique(transform(x, TIME = 0, CONC = 0)), x)
newX[order(newX$VAR),]
On Fri, Mar 11, 2011 at 9:28 AM, kyle.landskro...@actelion.com wrote:
Can someone help with a fairly simple task?
I have a data set where I would like to insert a 0 time event between
individuals:
Hi:
df - read.table(textConnection(
VAR DATETIME CONC COVAR
1 NOV20.2510 group1
1 NOV20.5 20 group1
1 NOV21 5 group1
1 NOV22 1 group1
1 NOV23 0.1 group1
2 NOV20.2510
Hi,
One liners in data.table are :
x.dt[,lapply(.SD,mean),by=sample]
sample replicate heightweight age
[1,] A 2.0 12.2 0.503 6.00
[2,] B 1.5 12.75000 0.715 4.50
[3,] C 2.5 11.35250 0.5125000 3.75
[4,] D 2.0
Hi, I'm trying to plot the dates on the x-axis of a persp plot, but
cannot find a way of doing so. This is where I am at:
|x- seq(-10, 10, length= 30)
x0- as.Date(2000-01-01)
x.dates- seq(x0,x0+length(x)-1,1)
y- x
f- function(x,y) { r- sqrt(x^2+y^2); 10 * sin(r)/r}
z- outer(x, y,
Try this:
aggregate(. ~ sample, x[-2], FUN = mean)
On Fri, Mar 11, 2011 at 6:32 AM, Aline Santos aline...@gmail.com wrote:
Hello R-helpers:
I have data like this:
samplereplicateheightweightage
A1.0012.00.646.00
A2.0012.20.386.00
A3.00
On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams
graham.willi...@togaware.com wrote:
Did you scroll down the window to see the rules?
OK, it takes a long time for rattle to show the rules, about 30
seconds, and why the message on the status bar is the decision tree
model has been built. Time
I’m wondering which is the most efficient (time, than memory usage) way to
obtain a multivariate time series object from a data frame (the easiest data
structure to get data from a database trough RODBC).
I have a starting point using timeSeries or xts library (these libraries can
handle time
Hi Francisco,
Thanks for your solution. It runs pretty fast compared to my for loop. Here
is a comparison of system.time():
system.time(splitVals - by(serv, dates, aggregateDf ))
user system elapsed
1.129 0.218 1.348
system.time(... my long for loop...)
user system elapsed
Hi,
I have been looking through all packages but I cannot find a routine for
LAD-regression (L1-norm-regression).
Is there none?
Willi
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
2011/3/11 David Winsemius dwinsem...@comcast.net:
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
I try to parse a time stamp with time zone. I essentially just want to
parse the time stamp 1995-05-25T15:30:00+10:00 and output it exactly
On Mar 11, 2011, at 8:41 AM, Benjamin Stier wrote:
Hi Francisco,
Thanks for your solution. It runs pretty fast compared to my for
loop. Here
is a comparison of system.time():
system.time(splitVals - by(serv, dates, aggregateDf ))
user system elapsed
1.129 0.218 1.348
Willi, try this:
install.packages(sos)
library(sos)
findFn(L1 norm regression)
I find 34 hits but you'd have to look them over to see if any of them
are the sort of thing you want.
HTH, Bryan
Prof. Bryan Hanson
Dept of Chemistry Biochemistry
DePauw University
602 S.
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
2011/3/11 David Winsemius dwinsem...@comcast.net:
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote:
On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote:
I try to parse a time stamp with time zone. I essentially just
want to
parse the time stamp
Thanks so much for the help! Sorry about not finding that info in the help.
I must have overlooked it. My apologies.
--
View this message in context:
http://r.789695.n4.nabble.com/Library-in-R-2-12-2-for-windows-tp3347351p3348218.html
Sent from the R help mailing list archive at Nabble.com.
On Mar 11, 2011, at 7:31 AM, Wilhelm Caspary wrote:
Hi,
I have been looking through all packages but I cannot find a routine
for LAD-regression (L1-norm-regression).
Is there none?
(In addition to the pkg::sos search results the help archives can also
be reviewed.)
Update: I ran the following commands on a Linux machine:
sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=de_DE.utf8 LC_NUMERIC=C
[3] LC_TIME=de_DE.utf8 LC_COLLATE=de_DE.utf8
[5] LC_MONETARY=de_DE.utf8
2011/3/11 David Winsemius dwinsem...@comcast.net:
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
Let me rephrase my question: How can I create a time object from the
character string 1995-05-25T15:30:00-10:00 and get exactly the same
character string again when formatting it/printing it?
x
Rainer,
The are probably lots of ways, I'd use
levels(interaction(c(a, b), c('x', 'y'), sep=''))
Dave
Hi
I know there is a function - I have used it before - but I always forget
what it is called...
I need the combination of two character vectors, i.e:
x - c(a, b)
y - c(x, y)
z -
On Mar 11, 2011, at 9:23 AM, Daniel Nüst wrote:
2011/3/11 David Winsemius dwinsem...@comcast.net:
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote:
Let me rephrase my question: How can I create a time object from the
character string 1995-05-25T15:30:00-10:00 and get exactly the
same
Is the L1 norm not equivalent to quantile regression for the 0.5th
quantile?
If so, quantreg would do it using rq with the defult value for tau.
S Ellison
Wilhelm Caspary wilhelm.casp...@unibw.de 11/03/2011 12:31
Hi,
I have been looking through all packages but I cannot find a routine
for
Hi,
Thanks for taking the time to respond.
After further investigation I suspect the invisible=FALSE has nothing to do
with the problem we're having. It may also be a different issue to the one Jim
has seen.
Jim describes the command window flashing up and disappearing. We saw this in R
On Wed, Mar 9, 2011 at 12:14 PM, Ralph Olsson
ralphols...@btinternet.com wrote:
Hello,
I work for a company in which a number of employees use R. Many of them like
to run executables via the system function in such a way that the output of
that executable is displayed in a separate window.
On 2011-03-11 01:07, Ivan Calandra wrote:
Hi,
From ?$, you can see that using [[ instead would do what you're
looking for. You should read and try to understand the whole help file.
The reason is that for [[ the default is exact=TRUE, wheareas for $ the
only possible value is exact=FALSE,
Dear all,
I have installed R-2.12.2 version on a Suse OS. I am trying to install the
Cairo package on R but I got this error message:
installing to /dades/R-2.12.2/lib64/R/library/Cairo/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep this simple
because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a -c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6)
b
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep this simple
because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a -c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6)
b
Dear R helpers
I have following data.frame and for each product_name, I have associated mean
and standard deviation. I need to generate 1000 random no.s for each of these
products and find the respective mean and standard deviation.
My R code is as follows.
library(plyr)
library(reshape2)
On Mar 10, 2011, at 05:49 , Tyler Rinker wrote:
My Question: What do I need to do to correct the three error codes R gives
me and make the function run correctly?
This is the session, code and R's error message when supplied with data:
rm(list=ls())
dat1-read.table(dat1.csv,
On Mar 11, 2011, at 10:49 AM, Bodnar Laszlo EB_HU wrote:
Dear R-community,
I'd like to ask you a question concerning R again. I try to keep
this simple because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a
Hi, I have tried to load a file originally from Excel, via csv, text and
clipboard today.
When I succeed I cannot change the format from factor, and when I try to
convert it to numerical it only gives the position of the factor-group, not
the real value in the column?
Any quick suggestions?
I have found the various tz arguments not to provide the support I would like
in terms of arbitrary timezones. For now I use Sys.setenv(TZ=timezone_spec)
prior to input or output, and do not use the tz arguments.
In your case, I would consider keeping a character copy of the input to write
out
Hi Rainer
Or maybe you are referring to the outer function.
I'm a newbie in R, but I recently read something about it in the pdf book named
below (pages 91-2). I send to you an excerpt:
An introduction to R
An introduction to R
Longhow Lam
6.2.5 The outer function
outer function
Hi,
I think, what you want is assign().
for (i in 1:6) assign(paste(df, i, sep=.), split(df,df$a)[[i]])
But using lists is usually a better solution since you can work with
them using functions such as lapply().
First, you don't need cbind() to create your data.frame:
df2 - data.frame(a,b)
Thank you Philipp, it is very useful! How come I haven't figured it out
myself I dont know...
Have a pleasant weekend!
Laszlo
--
View this message in context:
http://r.789695.n4.nabble.com/creating-additional-column-tp3341224p3348552.html
Sent from the R help mailing list archive at Nabble.com.
If you are using 'read.csv', add the parameteras.is=TRUE to
prevent conversion to factors.
If you have factors that are supposed to be numeric, use the following
df$mydata - as.numeric(as.character(df$mydata))
On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson
Hi helpeRs,
I have inherited a set of data files that use the file system as a
sort of poor man's database, i.e., the data files are nested in
directories that indicate which city they come from. For example:
dir.create(deleteme)
for(i in paste(deleteme, c(New York, Los Angeles), sep=/)) {
Hi Andreas,
Assuming you are using read.table(), try setting the argument:
stringsAsFactors = FALSE
Also consider what about the Excel file is making R default to a
factor rather than numerical? There may be a nonstandard
reprsentation of missing data (e.g., .), which could also be
specified to
You can only return a single object. You might want to create a list
if you have multiple objects:
return(list(output_avg_mc, output_stdev_mc))
On Fri, Mar 11, 2011 at 10:51 AM, Vincy Pyne vincy_p...@yahoo.ca wrote:
Dear R helpers
I have following data.frame and for each product_name, I
Hi Andreas,
if your factor is named x, you can do
as.numeric(as.character(x))
Best,
Ista
On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson
andreas.emanuels...@sik.se wrote:
Hi, I have tried to load a file originally from Excel, via csv, text and
clipboard today.
When I succeed I cannot
Thanks. This is a bug, the source code made an implicit assumption that there
would always be at least one smooth, when creating the gam object after
fitting. Fixed for the next release (1.7-5). For now, you could use glmmPQL
from the MASS library to get an equivalent fit when there are no
Hi,
the R.filesets package was designed for this. It is heavily used by
the aroma framework (http://www.aroma-project.org/), so it got a fair
bit of mileage now (in a good a way). Here is how you could setup
your data set and work with the data.
# - - - - - - - - - - - -
# Setup file data set
Thanks Henrik, that is exactly what I was hoping for!
Best,
Ista
On Fri, Mar 11, 2011 at 1:02 PM, Henrik Bengtsson h...@biostat.ucsf.edu wrote:
Hi,
the R.filesets package was designed for this. It is heavily used by
the aroma framework (http://www.aroma-project.org/), so it got a fair
bit
Hello!
The code below works and does what I need it to do.
However, I think the way I create myframe (last step) is very
un-R-like and probably not very efficient. I am sure there are better,
more R-appropriate methods.
Any pointers?
Thanks a lot!
Dimitri
# Step 1: Creating a vector of dates:
On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote:
Hello!
The code below works and does what I need it to do.
However, I think the way I create myframe (last step) is very
un-R-like and probably not very efficient. I am sure there are better,
more R-appropriate methods.
Any pointers?
Thanks a lot, David!
Exactly what I was looking for!
Dimitri
On Fri, Mar 11, 2011 at 1:46 PM, David Winsemius dwinsem...@comcast.net wrote:
On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote:
Hello!
The code below works and does what I need it to do.
However, I think the way I create
I am encountering an error with plot.lm:
tstdf - data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
plot(lm(I(y) ~ x, data=tstdf))
Hit Return to see next plot:
Hit Return to see next plot:
Error in object$coefficients : $ operator is invalid for atomic vectors
Obviously I don't need the I()
On 2011-03-10 15:07, Jim Price wrote:
Hi,
I'm currently designing some global themes for use with lattice, and have
hit a snag. There doesn't appear to be (in xyplot at least) a way of setting
a lattice option for the 'scales' parameter at a global level - changes have
to be made in each
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote:
I am encountering an error with plot.lm:
tstdf - data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
plot(lm(I(y) ~ x, data=tstdf))
Hit Return to see next plot:
Hit Return to see next plot:
Error in object$coefficients : $ operator is
I like Thomas's idea as a quick practical solution. Here is one more little
variation just in case you really do have millions of these distances. Pick
point P1 on line segment L1 (e.g., an endpoint). Pick 101 evenly spaced points
on line segment L2. Find the nearest to P1 and call it P2.
I think I need to retract the part about 3 iterations... not true if, e.g.,
the segments intersect and the angle is small.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of rex.dw...@syngenta.com
Sent: Friday, March 11, 2011 2:37
Perfect, thanks Josh!
Cheers,
A
2011/3/10 Joshua Wiley jwiley.ps...@gmail.com
Dear Aaron,
The problem is not with your function, but using apply(). Look at the
Details section of ?apply You will see that if the data is not an
array or matrix, apply will coerce it to one (or try). Now go
Hi,
this sounds like a standard problem in Computational Geometry - I guess
game developers have to deal with something like this all the time. You
may want to look at a textbook or two.
An article with the promising title On fast computation of distance
between line segments can be found
Hello all,
I'm new to R and trying to figure out how to perform calculations on a large
dataset (300 000 datapoints). I have already made some code to do this but it
is awfully slow. What I want to do is add a new column for each rep_ column
where I have taken each value and divide it by
Does anyone know of any R code for computing partial cross-correlation? I have
examples of cross correlation functions (ccfs) that are not smooth but rather
consist of a peak of several high values in consecutive lags, with sharp drops
on either side. This indicates that y(t) is a function of
Also called Sen's slope estimate...
--
View this message in context:
http://r.789695.n4.nabble.com/Kendall-Theil-line-as-fit-tp3344617p3348823.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
?pacf
On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote:
Does anyone know of any R code for computing partial cross-
correlation? I have examples of cross correlation functions (ccfs)
that are not smooth but rather consist of a peak of several high
values in consecutive lags, with sharp drops
Belay that. I misread the post.
On 11-Mar-11, at 12:09 PM, Don McKenzie wrote:
?pacf
On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote:
Does anyone know of any R code for computing partial cross-
correlation? I have examples of cross correlation functions
(ccfs) that are not smooth but rather
To get the equivalent of what your loop does, you could use
lapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean))
but you might find the output of
sapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean))
to be more useful.
- Phil Spector
Dear all, when I put date objects (class of 'Date') in a matrix it becomes
numeric:
dat - matrix(seq(as.Date(2011-01-01), as.Date(2011-01-09), by=1
day), 3)
dat
[,1] [,2] [,3]
[1,] 14975 14978 14981
[2,] 14976 14979 14982
[3,] 14977 14980 14983
class(dat[1,1])
[1] numeric
As
On 2011-03-11 11:31, David Winsemius wrote:
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote:
I am encountering an error with plot.lm:
tstdf- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4))
plot(lm(I(y) ~ x, data=tstdf))
HitReturn to see next plot:
HitReturn to see next
Haakon,
as replicates imply that they all have the same data type, you can put
them into a matrix which is often faster and needs less memory (though
whether that can really matter depends of the number of replicates you
have: for small no of replicates you won't have much effect anyways).
It will be difficult or impossible to store objects of
class Date in a matrix -- you'll need to store them
in a data frame:
pts = seq(as.Date(2011-01-01), as.Date(2011-01-09), by=1 day)
z = data.frame(pts[1:3],pts[4:6],pts[7:9])
z
pts.1.3. pts.4.6. pts.7.9.
1 2011-01-01 2011-01-04
On Fri, Mar 11, 2011 at 4:15 PM, Bogaso Christofer
bogaso.christo...@gmail.com wrote:
Dear all, when I put date objects (class of 'Date') in a matrix it becomes
numeric:
dat - matrix(seq(as.Date(2011-01-01), as.Date(2011-01-09), by=1
day), 3)
dat
[,1] [,2] [,3]
[1,] 14975 14978
Thank you for indicating more precisely where the bug arises.
I disagree with the blanket assertion that the I() is not needed. The example
is purposely simplified to illustrate the problem, which lm has no difficulty
with but which plot.lm does. plot.lm manages to deal with I() on the right
On Mar 11, 2011, at 20:31 , David Winsemius wrote:
Are you sure you need I() on the LHS? The I function is designed to avoid the
confusion related to the dual use of the arithmetic operator symbols
affecting the construction of the model matrix, but I don't think that
applies to the
I have a text file of R commands. Some times I only want to run a few lines
of the R commands in an existing R session and wonder whether there is a
simple way to do this.
To run a few lines in a new session of R, I could use sed to pick up the
lines from the file and pipe them into R.
source()
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng pywp...@gmail.com wrote:
I have a text file of R commands. Some times I only want to run a few lines
of the R commands in an existing R session and wonder whether there is a
simple way to do this.
To run a few lines in a new session of R, I could
Hi
I would like to be able to add reference lines to a series of plots that are
built using the Grid graphics package. These lines should coincide with tick
marks which are different on each plot.
I can add the lines manually using the grid.lines() function but would like
to understand how to
You can do:
source(readLines(yourFile)[10:20]) # lines 10-20 of the file
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng pywp...@gmail.com wrote:
I have a text file of R commands. Some times I only want to run a few lines
of the R commands in an existing R session and wonder whether there is a
I meant to say, but my fingers got ahead of my brain:
source(textConnection(readLines(yourFile)[10:20]))
On Fri, Mar 11, 2011 at 4:53 PM, jim holtman jholt...@gmail.com wrote:
You can do:
source(readLines(yourFile)[10:20]) # lines 10-20 of the file
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y.
On 2011-03-11 13:33, Jeff Newmiller wrote:
Thank you for indicating more precisely where the bug arises.
I disagree with the blanket assertion that the I() is not needed. The
example is purposely simplified to illustrate the problem, which lm has
no difficulty with but which plot.lm does.
Apologies
I forgot to include that the reference lines should be for the y axis only.
Thanks.
Pete
--
View this message in context:
http://r.789695.n4.nabble.com/Reference-Lines-Using-Grid-Graphics-tp3349185p3349206.html
Sent from the R help mailing list archive at Nabble.com.
It is easy to recover the date by using as.Date:
dat - matrix(seq(as.Date(2011-01-01), as.Date(2011-01-09), by=1 day),
3)
dat
[,1] [,2] [,3]
[1,] 14975 14978 14981
[2,] 14976 14979 14982
[3,] 14977 14980 14983
str(dat)
num [1:3, 1:3] 14975 14976 14977 14978 14979 ...
as.Date(dat)
1 - 100 of 116 matches
Mail list logo