On Sun, Sep 12, 2010 at 9:40 AM, Sebastian Gibb wrote:
> But I want to do a "sapply" over the "values" vectors.
>
Try multivariate apply. For more on loops and the apply family check
[1]. You might also want to check the plyr package and its
documentation.
Liviu
[1] http://promberger.info/files/rn
Thanks everyone. I've also had a look at plotmath.c where bgroup is
defined for "[", "{", "(", "." but not "<". It seems quite trivial to
add it, at first sight, however there is a part that I don't
understand in the RenderDelim routine,
static BBOX RenderDelim(int which, double dist, int draw, ma
Sorry, I was too vague in my initial question. To make it clearer I
included the following example:
tmp <- data.frame(y=runif(10), x=gl(2,5), class=gl(2,5))
p <- ggplot(data = tmp)
p <- p + geom_point(aes(y=y, x=x))
p <- p + facet_wrap(~ class, scales = "free")
p <- p + ylim(0, 1)
p
This code
Try SciViews-K, an extension for Komodo Edit to transform it into a R
editor and GUI.
http://www.sciviews.org/SciViews-K/index.html
On 2010-8-2 23:35, alphaace wrote:
Hi Everyone,
I recently have started using R again on a Linux box after spending several
years on a Mac. Last I checked, the b
Esteemed useRs and developeRs,
I need to create a '3D line plot' (proper name?) of which an excellent
example can be viewed here:
http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg
I have some experience using the rgl package to create 3D PCA plots, but
have no idea where to s
Hello,
thanks for your answer.
mapply fits to my needs.
But I don't know how many items would "tree" have. I can't write them all by
hand.
How can I generate the arguments for mapply?
mapply(mean, tree[[1]]$node$values, tree[[2]]$node$values, ...
tree[[k]]$node$values);
Kind regards,
Sebastia
Hello Werner,
good question.
According to this source:
http://devdaily.com/blog/post/latex/multi-line-comments-in-latex-begin-123-
comment-125-verbatim
this can be done with
\usepackage{verbatim}
and
\begin{comment}
This is my comment.
Note that it can span multiple lines.
This is very usefu
On 12/09/2010 10:12 AM, Karl Brand wrote:
Esteemed useRs and developeRs,
I need to create a '3D line plot' (proper name?) of which an excellent
example can be viewed here:
http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg
I have some experience using the rgl package to create
I appreciate all you help. This is only for instructional purpose:
A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19), ncol=5,
byrow=T)
B =matrix(sample(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),),
ncol=5, byrow=T)
Which print func( A, B, A+B) can print the resulting m
On Sep 12, 2010, at 10:12 AM, Karl Brand wrote:
Esteemed useRs and developeRs,
I need to create a '3D line plot' (proper name?) of which an
excellent example can be viewed here:
http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg
Set up blank plot region with proper ranges
Just a follow-up on this thread, now with R 2.11.1. I was happy back
then to use Deepayan's solution for this, under earlier R versions; but
it now gives an error and the Sweave-generated .tex file no longer compiles.
<>=
library(nlme)
library(lattice)
xyplot(distance ~ age|Sex, data=Orthodont
On 12/09/2010 11:41 AM, Michael Friendly wrote:
Just a follow-up on this thread, now with R 2.11.1. I was happy back
then to use Deepayan's solution for this, under earlier R versions; but
it now gives an error and the Sweave-generated .tex file no longer compiles.
<>=
library(nlme)
library(l
What happens if I want to automate this process for say 500 vectors?
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-you-output-a-vector-to-a-column-in-excel-tp2530470p2536402.html
Sent from the R help mailing list archive at Nabble.com.
__
Greeting R helpers J
I am not familiar with R but I have to use it to analyze data set that I have
(30,000 20,000)
I want to change the structure of the dataset and I am wondering how that might
be possible in R
A main data looks like this: some entities are empty
AgeNo. Age
On Sep 12, 2010, at 10:45 AM, Natasha Asar wrote:
Greeting R helpers J
I am not familiar with R but I have to use it to analyze data set
that I have
(30,000 20,000)
I want to change the structure of the dataset and I am wondering how
that might
be possible in R
A main data looks like this
Well that depends which process you are automating, how your vectors
are stored, and where you want them going. Do you want 500 Excel
spreadsheets with each vector in Column A? Do you want 1 spreadsheet
with each vector appended below the previous? Do you want 1
spreadsheet with each vector in t
Hi:
Another approach is to use lattice:
http://lmdvr.r-forge.r-project.org/figures/figures.html
Go to Chapter 14 and click on Figure 14.3; the code is on the RHS of the
figure.
HTH,
Dennis
On Sun, Sep 12, 2010 at 7:12 AM, Karl Brand wrote:
> Esteemed useRs and developeRs,
>
> I need to creat
On Sep 12, 2010, at 11:27 AM, Cuckovic Paik wrote:
I appreciate all you help. This is only for instructional purpose:
A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),
ncol=5,
byrow=T)
B
=matrix(sample(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),),
ncol=5, byrow=
Hi:
Here's a made up example using the reshape function:
Input data:
df <- structure(list(center = 1:3, age1 = c(6L, 7L, 5L), n1 = c(10L,
12L, 6L), age2 = c(8L, 8L, 8L), n2 = c(13L, 14L, NA), age3 = c(10L,
10L, 9L), n3 = c(9L, NA, 10L), age4 = c(12L, 11L, 11L), n4 = c(7L,
16L, 12L), age5 = c(14L,
Wil M Contreras Arbaje gmail.com> writes:
>
> Thanks Bill!
>
> Not asking for help with Stata at all, on the contrary: the article
> mentioned using Stata to fit the model described earlier, and I wasn't
> sure how to do the same in R (which is what I've used since college).
>
> Thanks aga
On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch
wrote:
> On 12/09/2010 11:41 AM, Michael Friendly wrote:
>>
>> Just a follow-up on this thread, now with R 2.11.1. I was happy back then
>> to use Deepayan's solution for this, under earlier R versions; but it now
>> gives an error and the Sweave-ge
Hi all,
Say if I have a data table which consists of 4 column: itemID, location and
price, which location is a text field and itemID and location together forms
the primary keys.
when I tried to run setkey (DT, itemID, location), I got the following
message:
Error in setkey (DT, itemID, location
Worked great, thanks!
On Sep 11, 2010, at 8:26 PM,
wrote:
> Is this the kind of thing you are talking about?
>
> ### 8< cut here 8< ###
> A <- rep(NA, 100)
> B <- sort(runif(25))
> C <- sort(sample(1:100, 25))
>
> A[C] <- B
> B
> C
> A
> ### 8< cut here 8< ###
>
>
> (The sorting is not nec
I am using read.table to import a text file within R.
There are several "errors" in my text file. An "extra" quotation mark has
inadvertently been included within a few text fields.
e.g. for a pipe (|) delimited text file, I have something similar to this:
1|7|30| "dog"
2|6|25| ""cat"
3|4
Thank you Ben,
From the article, the purpose of the author's methodology is to
better handle heteroskedasticity (due, in part, to Jensen's
inequality). Either way, I'll try both, and see how they compare, as
I'd like the R estimation to match the Stata one.
Thanks again for your insight,
I changed it so i hope it will look better now
the matrix is like this:
AgeNo. Age No. AgeNo.
Center1 52 8 7
Center210 720 9 4 10
column name = sequence of age-no.
But what I want the data to loo
I am sending this again as they told me that the data was unreadable, so really
hope that this will work...so sorry all
note: matrix contains a lot of empty entities
Greeting R helpers
I am not familiar with R but I have to use it to analyze data set that I have
(30,000 20,000)
I want to change
Hi all,
I am just wondering if there is a more efficient way of merging two large
datasets based on the values of multiple columns, some of which are not
numerical.
The default merge function in dataframe is very inefficient and the merge
function in data.table seems to be faster, but it does not
Thanks Deepayan and Duncan. The eval=FALSE was the problem, rather than
anything with
lattice. Not sure why that worked earlier, but I no longer care.
-Michael
Deepayan Sarkar wrote:
On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch
wrote:
On 12/09/2010 11:41 AM, Michael Friendly wrote:
Hi:
Convert the location to factor and you should be OK:
x <- factor(sample(LETTERS[1:3], 10, replace = TRUE))
storage.mode(x)
[1] "integer"
BTW, data.table has its own mailing list:
Send datatable-help mailing list submissions to
datatable-h...@lists.r-forge.r-project.org
To subscribe
Hi:
Natasha said:
I changed it so i hope it will look better now
the matrix is like this:
AgeNo. Age No. AgeNo.
Center1 52 8 7
Center210 720 9 4 10
column name = sequence of age-no.
But what I w
Have you tried 'pasting' the values together and then using this as
the key for the join?
On Sun, Sep 12, 2010 at 2:39 PM, Anyi Zhu wrote:
> Hi all,
>
> I am just wondering if there is a more efficient way of merging two large
> datasets based on the values of multiple columns, some of which are
Hi,
I have a list of several hundred 2 dimensional matrices, where each matrix is n
x m. What I need to do is that for each n,m I need an average over all the
lists. This would collapse it down to just one nxm matrix. Any easy ways to do
that? As always, I'd like to avoid a for loop to keep co
On Sep 12, 2010, at 6:15 AM, baptiste auguie wrote:
Thanks everyone. I've also had a look at plotmath.c where bgroup is
defined for "[", "{", "(", "." but not "<". It seems quite trivial to
add it, at first sight, however there is a part that I don't
understand in the RenderDelim routine,
stat
Sorry, I forgot to add that some of the entries in various matrices have NA in
them.
On Sep 12, 2010, at 3:40 PM, Gregory Ryslik wrote:
> Hi,
>
> I have a list of several hundred 2 dimensional matrices, where each matrix is
> n x m. What I need to do is that for each n,m I need an average over
Gregory -
Suppose your list is called "mymats". Then
Reduce("+",mymats)
does what you want.
- Phil
On Sun, 12 Sep 2010, Gregory Ryslik wrote:
Hi,
I have a list of several hundred 2 dimensional matrices, where each matrix is n
x m. What I need to do is
Thanks for the feedback. Peter, I have forwarded your response to our ICT
division to see if there is anything they can do.
One potentially silly question: what would happen if I had the help files
loaded locally on my PC - would the call then work? I'm wondering about the
wisdom of creating a
Hi,
Doing that I get the following:
Browse[2]> Reduce["+",results]
Error in Reduce["+", results] :
object of type 'closure' is not subsettable
Thanks again!
Kind regards,
Greg
On Sep 12, 2010, at 3:49 PM, Phil Spector wrote:
> Gregory -
> Suppose your list is called "mymats". Then
>
> R
Oh, right I see. I was completely off then. Maybe it's not so easy to
add <> delimiters after all, I'll have to look at the list of symbol
pieces to see if these can be constructed too.
Thanks,
baptiste
On 12 September 2010 21:42, David Winsemius wrote:
>
> On Sep 12, 2010, at 6:15 AM, baptiste
You can use the 'gsub' command to remove the quote marks. You could
readLines/writeLines the file to clean it up with gsub before using
read.table on it so it can all be done within R.
On Sun, Sep 12, 2010 at 1:58 PM, Eva Nordstrom wrote:
> I am using read.table to import a text file within R.
>
Hi
On 13/09/2010 7:57 a.m., baptiste auguie wrote:
Oh, right I see. I was completely off then. Maybe it's not so easy to
add<> delimiters after all, I'll have to look at the list of symbol
pieces to see if these can be constructed too.
The plotmath stuff assumes a font with an Adobe Symbol en
On 12/09/2010 3:50 PM, Gosse, Michelle wrote:
Thanks for the feedback. Peter, I have forwarded your response to our ICT
division to see if there is anything they can do.
One potentially silly question: what would happen if I had the help files
loaded locally on my PC - would the call then work
Cheers!
All excellent, runable examples helping me progress quickly.
Being more a qualitative plot, the y-axis is less important. But it did
get me thinking-
Coloring each of the plotted lines, say 'altitude colors' like the
classic volcano example to reflect the (scaled) values the lines
r
I see, thanks. Looking at this table I guess the short answer is no,
these cannot be made to scale and the only ones that could have
already been implemented in bgroup().
Thanks,
baptiste
On 12 September 2010 22:11, Paul Murrell wrote:
> Hi
>
> On 13/09/2010 7:57 a.m., baptiste auguie wrote:
>
Hi:
On Sun, Sep 12, 2010 at 11:39 AM, Anyi Zhu wrote:
> Hi all,
>
> I am just wondering if there is a more efficient way of merging two large
> datasets based on the values of multiple columns, some of which are not
> numerical.
>
As noted in your previous post, the variables comprising the key
On Sep 12, 2010, at 4:11 PM, Paul Murrell wrote:
Hi
On 13/09/2010 7:57 a.m., baptiste auguie wrote:
Oh, right I see. I was completely off then. Maybe it's not so easy to
add<> delimiters after all, I'll have to look at the list of symbol
pieces to see if these can be constructed too.
The p
On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote:
Hi:
Natasha said:
I changed it so i hope it will look better now
the matrix is like this:
AgeNo. Age No. AgeNo.
Center1 52 8 7
Center210 720 9 4
While you are looking for a solution within R, it might be simpler to
open your text file in almost any free text editor (Notepad++,
Textwrangler, Smultron, vim come to mind), and do Replace all "' for ".
On Sep 12, 2010, at 3:58 PM, jim holtman wrote:
You can use the 'gsub' command to remo
Gregory Ryslik comcast.net> writes:
> Browse[2]> Reduce["+",results]
> Error in Reduce["+", results] :
> object of type 'closure' is not subsettable
>
You need to use parentheses, not square brackets.
__
R-help@r-project.org mailing list
https:/
Gregory -
Please provide a reproducible example.
I have no idea what results is.
- Phil
On Sun, 12 Sep 2010, Gregory Ryslik wrote:
Hi,
Doing that I get the following:
Browse[2]> Reduce["+",results]
Error in Reduce["+", results] :
object of type 'closure' i
Hi,
Thanks, I was using the square brackets instead of "(". The "(" makes it work.
However, some of my matrices have NA for some values. I need those NA's to
basically not be counted. And if all the lists have NA for a specific (n,m), I
want it to remain an (n,m). By using the Reduce('+', mymat
Hi:
Here's a fairly basic ggplot2 version with a few warts in it:
# Generate means
means <- rpois(30, 10)
# Create 30 Gaussian random samples of size 100, using means to
# define the population mean for each sample (via sapply)
df <- data.frame(ds = rep(1:30, each = 100),
x = as.vector(sapp
Hi:
On Sun, Sep 12, 2010 at 1:05 PM, Wil M Contreras Arbaje <
wil.contre...@gmail.com> wrote:
> While you are looking for a solution within R, it might be simpler to open
> your text file in almost any free text editor (Notepad++, Textwrangler,
> Smultron, vim come to mind), and do Replace all "'
Thanks, David; I overlooked that part.
Dennis
On Sun, Sep 12, 2010 at 1:18 PM, David Winsemius wrote:
>
> On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote:
>
> Hi:
>>
>> Natasha said:
>>
>> I changed it so i hope it will look better now
>> the matrix is like this:
>>Age
On Sep 12, 2010, at 12:24 PM, David Winsemius wrote:
On Sep 12, 2010, at 11:27 AM, Cuckovic Paik wrote:
I appreciate all you help. This is only for instructional purpose:
A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),
ncol=5,
byrow=T)
B
=
matrix(sample(c(0,1,1,-2,-3
True, I'd actually misread the problem as being "' and not "".
In the interest of expediency, here's one solution I can think off the
top of my head: using MS-Word (dunno if it's taboo in these lists, but
it's what I have at hand at the momentI believe in using all the
tools available, if i
CRAN (and crantastic) updates this week
New packages
* aratio (1.0)
Maintainer: Daniel McMillen
Author(s): Daniel McMillen
http://crantastic.org/packages/aratio
Tools for analyzing assessment ratios
* DeducerPlugInScaling (0.0-5)
Maintainer: Alberto Mirisola
Author(s):
Thanks David. grid graphic works pretty well.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-define-new-matrix-based-on-an-elementary-row-operation-in-a-single-step-tp2341768p2536785.html
Sent from the R help mailing list archive at Nabble.com.
__
My next suggestion (I don't have time to work out or test an example
at the moment):
library(abind)
tmparr <- abind(m1,m2,m3,...,along=3)
OR
tmparr <- do.call(c(matlist,list(along=3)))
apply(tmparr,c(1,2),mean,na.rm=TRUE)
or something along those lines.
__
I'm getting an error when applying all.equal() to objects of
class POSIXt.
E.g.
x <- strptime(rep("2007-02-12",10),format="%Y-%m-%d")
all.equal(x,x)
Error in target[[i]] : subscript out of bounds
The object seems to have to be of double-digit length to trigger the
error. E.g.
all.equal(x[1:9]
Hi Everyone,
Thanks to everyone for their help. With your suggestions and some poking
around, the following works for what I need. It basically adds all the matrices
elementwise, and adds nothing if the element is NA. Thanks again! Code below:
**
mymats <- vector('l
Hi:
Thanks to Jakson Aquino, who showed me how to do a proper text substitution,
we have a way out. It also turns out that in the last line, the last numeric
field was missing, so I inserted an NA| in the last line of the data file
before calling readLines(). His (correct) code is at the bottom of
Hello All,
I cant seem to do a trig regression in R.
The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2
a, b, c are coefs that I want.
y, x are input vectors.
The equation I put into R: lm(y ~ sin(2*pi*x/360)^2)
This equation is missing the c and I dont get the right answer.
Also,
I get the same error. On debugging, after the 10th iteration (~1,375
lines after the all.equal(x, x) call), I get:
exiting from: all.equal(target[[i]], current[[i]], check.attributes =
check.attributes,
...)
debugging in: all.equal(target[[i]], current[[i]], check.attributes =
check.attribute
On 2010-09-12 20:32, Joshua Wiley wrote:
I get the same error. On debugging, after the 10th iteration (~1,375
lines after the all.equal(x, x) call), I get:
exiting from: all.equal(target[[i]], current[[i]], check.attributes =
check.attributes,
...)
debugging in: all.equal(target[[i]], curr
On 13/09/2010, at 3:07 PM, Peter Ehlers wrote:
> I'm not sure that I would call this a bug, but it would seem
> helpful to return an appropriate error message or to coerce to
> POSIXct. Note that
>
> all.equal(as.POSIXct(x), as.POSIXct(x))
>
> yields TRUE, as does using as.Date(x).
On Sep 12, 2010, at 10:23 PM, Aaditya Nanduri wrote:
Hello All,
I cant seem to do a trig regression in R.
The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2
a, b, c are coefs that I want.
y, x are input vectors.
The equation I put into R: lm(y ~ sin(2*pi*x/360)^2)
This equation
Though I have read quite a bit, and tried quite a bit, I have yet to
find a nice way to overlay 2 or more curves in the same plot, with
different ranges.
Here is simplified sample code to demonstrate the question:
> plot(2*(seq(1,5)), type="l", axes=FALSE)
> curve(2*(seq(1,5)), type="b", add=TR
Hi,
I have a dataset from ILO, originally in csv-format, that I have read into
R. It is cross-sectional time-series data, so I have a bunch of variables
and dummy variables that I need to extract data from for the entire time
period. However, the years are separated by columns instead of rows, as
69 matches
Mail list logo