Dear all;
Working with the following code extracted from the document S Poetry
by Patrick Burns (from CRAN), I haven't been able to load the
resulting dll into R. The code is basically the calculation of the
quadratic form x'Qx:
static double quad_form(double *Q, double *x, long n)
{
lon
Yes, I am aware of that.
RODBC connection is automatically shutting down without any warnings or
error message. (That's why I jotted down Oracle error message when trying to
reconnect).
I don't think it's a matter of Oracle since I've tested many query works
simultaneously with multiple windows
Deepayan,
Oopps! You are correct. I read that entire entry (quite long) several
times and somehow missed it. I guess I have the bad habit of going straight
to the examples to better understand how the code works, and there are no
examples that wrap print calls around the plots.
Regardle
See if this gets you closer to what you want.
x1 <- c(1,2,3,4,5)
x2 <- c(2,4,6,8,10)
mod <- lm (x2~x1)
hm <- function (x) (mod$coe[1]+x*mod$coe[2])
plot.new()
# ...
box()
curve (hm,lty=1,xaxs="i", xlim=c(0,1), yaxs="i", xlab="", xaxt="n" )
Seemed as though the , add=TRUE, parameter was
I am checking a package with R CMD check and everything is fine until
the pdf portion of the checking process and the errors documented at
the end of this message happen. I have looked at the pdf that is
created and the typesetting is not perfect, but it is acceptable
(readable). I am no good at
try this:
> tags <- c("aaa", "ttt", "ccc", "gcc", "atn")
> key <- c(a=0, c=1, g=2, t=3, n=0)
> x <- t(sapply(strsplit(tags, ''), function(z) key[z]))
> x
a a a
[1,] 0 0 0
[2,] 3 3 3
[3,] 1 1 1
[4,] 2 1 1
[5,] 0 3 0
On Mon, Jan 5, 2009 at 8:26 PM, Gundala Viswanath wrote:
> Dear all,
>
> Gi
Hello -
kayj wrote:
Hi all
I have a data set with the total number of columns =ncol, and the total
number of rows=nrow. I am trying to loop over the values and id the value is
less than or equal to 100 to be changed to 1. if the value is greater than
100 , to be changed to 0. if NA , let X[i,j
Try vectorizing instead of a loop:
> da <- matrix(nrow=10,ncol=10)
> n <- sample(1:100, 40)
> da[n[1:20]] <- 99
> da[n[21:40]] <- 199
> X <- ifelse(is.na(da), NA, ifelse(da <= 100, 1, 0))
>
>
> X
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] NA NA NA NA NA1 NA NA
Dear all,
Given such vector of array.
tags <- c("aaa", "ttt", "ccc", "gcc", "atn")
How can I obtain a matrix corresponding to it
[,1] [,2] [,3]
[1,]000
[2,]333
[3,]111
[4,]211
[5,]03 0
In principle:
1. Number of Column in matrix
On Mon, Jan 5, 2009 at 4:57 PM, Mike Williamson wrote:
> Greg, others,
>
>Thanks for the info! I suspect you are right, Greg.
>
>The main issue, as Sundar Dorai-Raj (who posts here at times) told me in
> person and you say indirectly below, is that the "levelplot" function
> returns an ob
On 05/01/2009 6:42 PM, jaey.ahn wrote:
Hi, I encounter a problem when using more than 1 Rgui/Rcmdr with RODBC
connection.
As I use more than 1 RODBC connection with multiple Rgui/Rcmdr windows, my
network connection (including internet) is shutting down. Thus the only
solution to fix (so far) i
Greg, others,
Thanks for the info! I suspect you are right, Greg.
The main issue, as Sundar Dorai-Raj (who posts here at times) told me in
person and you say indirectly below, is that the "levelplot" function
returns an object and not a graph. I didn't really know what that *meant*,
eve
Hi, I encounter a problem when using more than 1 Rgui/Rcmdr with RODBC
connection.
As I use more than 1 RODBC connection with multiple Rgui/Rcmdr windows, my
network connection (including internet) is shutting down. Thus the only
solution to fix (so far) is to reboot the computer.
I suppose ROD
Hi all
I have a data set with the total number of columns =ncol, and the total
number of rows=nrow. I am trying to loop over the values and id the value is
less than or equal to 100 to be changed to 1. if the value is greater than
100 , to be changed to 0. if NA , let X[i,j]=NA. I ran into a pro
Dear Prof. Ripley,
thanks for your reply.
Unfortunately I still was not able to solve the problem.
I tried it with the Iris data and you can find the code below:
> panel.cor <- function(x, y, digits=2, prefix="", cex.cor)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1)
I want the curve to touch the y axis like the curve touches the upper boundary.
How can I eliminate the margin between axis and curve on the left side?
x1 <- c(1,2,3,4,5)
x2 <- c(2,4,6,8,10)
mod <- lm (x2~x1)
hm <- function (x) (mod$coe[1]+x*mod$coe[2])
plot.new()
# ...
box()
curve (hm,lty=1,add=
whoops -- I left the group size unchanged so k became greather than
the length of the group vector. When I increase the size to 1e7,
sapply is faster until it gets to k = 1e6.
warning: this takes awhile (particularly on my machine which seems to
be using just 1 of it's 2 cpus)
> for(k in 10^(1
On Sun, 4 Jan 2009, Stavros Macrakis wrote:
On Sun, Jan 4, 2009 at 4:50 PM, wrote:
On Sun, 4 Jan 2009, Stavros Macrakis wrote:
On Sat, Jan 3, 2009 at 7:02 PM, wrote:
R's interpreter is fairly slow due in large part to the allocation of
argument lists and the cost of lookups of variables,
I suspect that the graph not printing when the if statement follows the command
(even commented out), may be faq 7.22, you are making the R parser guess at
what you want and sometimes it guesses correctly, and sometimes not. If you
wrap your call to levelplot in a print function call, then R do
Here's some more timing's of Bill's function. Although in this
example sapply has a clear performance advantage for smaller numbers
of groups (k) , gm is substantially faster for k >> 1000:
gm <- function(x, group){ # medians by group:
o<-order(group, x)
group <- group[o]
x <- x[o]
c
Hi,
I tried for the first time the function read.mtp, and get a "file read
error." Searching the archive didn't bring anything up on this.
> read.mtp("junk.mtp")
Error in read.mtp("junk.mtp") : file read error
The file is a portable Minitab v15 file, numeric only.
Of course there are workarou
On Mon, Jan 05, 2009 at 01:52:00PM -0600, Sebastian P. Luque wrote:
> <>=
> layout(matrix(1:2, ncol=2)); par(mar=c(5, 4, 2, 1), cex=0.75)
> matplot(thetas, cbind(prior, lik, post), type="l", lty=c(2, 1, 1),
> xlab="theta", ylab="probability density")
> lik <- dbinom(60, 100, thetas)
> lik.p
Is this homework? Anyway, the attachment has been stripped off. Here
is how to plot the function.
fun <- function(x, y){
a <- 4
b <- x^2
d <- y^2
z <- a-b-d
return(z)
}
a <- fun(seq(-1000,1000,1), seq(-1000,1000,1))
plot(a)
#integration s
On Mon, 05 Jan 2009 15:14:37 -0500,
Duncan Murdoch wrote:
[...]
> You missed an @ after this chunk. If this is true in the original,
> I'm surprised Sweave didn't report an error, but it probably ate up
> the second chunk as part of the first.
AFAIK there's no need to separate every chunk by "
On 1/5/2009 2:52 PM, Sebastian P. Luque wrote:
Hi,
With the following Sweave minimal file:
------
\documentclass{article}
\usepackage{Sweave}
\begin{document}
<>=
thetas <- seq(0, 1, by=0.001)
prior <- rep(1, length(thetas
Hello,
I am a student and I working with R. I want to ask you how to solve
this integral which is shown in image attach with this letter. And how
to draw this function z = 4 – x2 – y2 , width intervals x = ±1, y =
±1. Thank You.
Yours sincerely,
Jolanta
Hi,
With the following Sweave minimal file:
------
\documentclass{article}
\usepackage{Sweave}
\begin{document}
<>=
thetas <- seq(0, 1, by=0.001)
prior <- rep(1, length(thetas)) / length(thetas)
lik <- dbinom(1, 1, thetas)
l
On Mon, 5 Jan 2009, Andreas Wittmann wrote:
Dear R users,
i would like to transform the following function from R-code to C-code
and call it from R in order to speed up the computation because in my
other functions this function is called many times.
`dgcpois` <- function(z, lambda1, lamb
On Sun, Jan 4, 2009 at 5:28 PM, Bert Gunter wrote:
> Folks:
>
>> Lme() is only able to work with nested random effects, not with crossed
>> random effects.
>
> Not quite true. Crossed models **can** be done, albeit clumsily, via
> pdMatrix objects: the Bates/Pinheiro book even contains an example
Arg, the 'sapply(...)' in the function was in the initial
comment,
gm <- function(x, group){ # medians by group:
sapply(split(x,group),median)
but someone's mailer put a newline before the sapply
gm <- function(x, group){ # medians by group:
sapply(split(x,group),median)
so it got execute
No, error message from your ODBC driver ...
Your table names are not valid SQL names. The details depend on the exact
driver, but you could try omitting the final dollar. This may not
work, in which case you may need to use an sqlQuery call.
On Mon, 5 Jan 2009, giovanni parrinello wrote:
> Another application of that technique can be used to quickly compute
> medians by groups:
>
> gm <- function(x, group){ # medians by group:
> sapply(split(x,group),median)
> o<-order(group, x)
> group <- group[o]
> x <- x[o]
> changes <- group[-1] != group[-length(group)]
> first <- whi
> -Original Message-
> From: hadley wickham [mailto:h.wick...@gmail.com]
> Sent: Sunday, January 04, 2009 8:56 PM
> To: William Dunlap
> Cc: gallon...@gmail.com; R help
> Subject: Re: [R] the first and last observation for each subject
>
> >> library(plyr)
> >>
> >> # ddply is for splitt
On Mon, Jan 5, 2009 at 6:30 AM, wrote:
> My question is motivated by dealing with pairs of values, like (3,12.5),
> (16,2.98), and so on
> that are mapped to a cartesian plain (Time, Frequence)
> I miss C multidimensional arrays. I am trying to simulate the 3rd dimension
> by declaring a matri
Why do you take 2.54? I think you forgot a bracket...
#par(mar = c(max(strwidth(names(x)) * 2.54, 4,4,2))
#
#should be
par(mar = c(max(strwidth(names(x))) * 2.54, 4,4,5))
#and 5 would be a better value. But this is merely trial and error?!
Regards
Thomas Kaliwe
Henrique Dallazuanna schrieb:
Try this:
par(mar = c(max(strwidth(names(x)) * 2.54, 4,4,2))
barplot(x, las = 3)
On Mon, Jan 5, 2009 at 2:15 PM, Thomas Kaliwe wrote:
> Dear members,
>
> Is there a way to turn a strwidth of a string into a number of lines that
> ist needed to display the string when using par(mar = c(?,4,4,2)
Dear members,
Is there a way to turn a strwidth of a string into a number of lines
that ist needed to display the string when using par(mar = c(?,4,4,2))
x = 1:5
names(x) = c("Z","Zz","ZZZl","T","Zzhtsddfg" )
par(mfrow = c(1,2))
par(mar = c(8,4,4,2))
barplot(x, las = 3
My question is motivated by dealing with pairs of values, like (3,12.5),
(16,2.98), and so on
that are mapped to a cartesian plain (Time, Frequence)
I miss C multidimensional arrays. I am trying to simulate the 3rd dimension by
declaring a matrix of lists.
R seems to accept the definition of su
Hi com,
I'm writing an R extension which uses a NAMESPACE file.
Well I want to export all objects which don't have an "prefix" as part
of name.
Something like:
exportPattern("^(?!prefix).+?", perl = TRUE)
but it does not work
Is there any way to do this?
Cheers
Biczok
channel <- odbcConnectExcel("nuova tabella terapia occupazionale mod.xls")
> ## list the spreadsheets
> sqlTables(channel)
TABLE_CAT
TABLE_SCHEM TABLE_NAME
1 c:\\TABELLE DEFINITIVE\\nuova tabella terapia occupazionale mod
It is the_vectorized_ performance differences that may be in part
explained by compiler settings. The interpreter overhead (not just
loops) is not.
luke
On Mon, 5 Jan 2009, Denney, William S. wrote:
Hello,
I don't think that the large disparity in loop performance between
Matlab, R, and Octa
> Can anyone can help me in creation ratetable object assuming, that I have
> mortality rates organized in standard way by year, gender and age (0-99).
Look at technical report #63, "Expected Survival Based on Hazard Rates",
Department of Health Science Research, Mayo Clinic. You can find it on
Hello,
I don't think that the large disparity in loop performance between
Matlab, R, and Octave is explained by compilation time performance
settings. For Octave, it is well known that loops perform poorly
relative to Matlab (though many other operations perform better). The
reason is that Matla
On Sun, Jan 4, 2009 at 6:51 PM, Jason Rupert wrote:
> Understood. Will head the warning about odd way to display data.
>
> Any recommendations about where I look to find full details about "qplot".
>
> I tried ?qplot, but it did not return full details.
>
> That description was missing a few item
Dear R users,
i would like to transform the following function from R-code to C-code and call
it from R in order to speed up the computation because in my other functions
this function is called many times.
`dgcpois` <- function(z, lambda1, lambda2)
{
`f1` <- function(alpha, lambda1, lambda2
Well, I suppose he might get away with it as long as said *Brian
Ripley* doesn't read this list ... ;-)
Sorry, couldn't resist,
Stefan
On 28 Dec 2008, at 21:07, stephen sefick wrote:
Is that an appropriate request?
On Sun, Dec 28, 2008 at 2:14 PM, Marcus Vinicius
wrote:
Dear R user´s,
Duncan Murdoch wrote:
> Shruthi Jayaram wrote:
>> Hi,
>>
>> How do I check for two conditions in an if loop? I want to check if a
>> value
>> lies between 2 other values.
>>
> "if" isn't normally a loop, but what you want is the vectorized
> version, the ifelse() function.
>> For example,
>> A <
Hi
r-help-boun...@r-project.org napsal dne 05.01.2009 12:41:49:
>
> Hi,
>
> How do I check for two conditions in an if loop? I want to check if a
value
> lies between 2 other values.
>
> For example,
>
> A <- ts(rnorm(120), freq=12, start=c(1992,8))
> X <- 0.5
> Y <- 0.8
>
> I would like
Hello,
If you do
C <- A
C[A > X & A < Y] <- 0
you get what it seems you want.
Best regards,
Carlos J. Gil Bellosta
http://www.datanalytics.com
On Mon, 2009-01-05 at 03:41 -0800, Shruthi Jayaram wrote:
> A <- ts(rnorm(120), freq=12, start=c(1992,8))
> X <- 0.5
> Y <- 0.8
_
Shruthi Jayaram wrote:
Hi,
How do I check for two conditions in an if loop? I want to check if a value
lies between 2 other values.
"if" isn't normally a loop, but what you want is the vectorized version,
the ifelse() function.
For example,
A <- ts(rnorm(120), freq=12, start=c(1992,8))
X
Hi,
How do I check for two conditions in an if loop? I want to check if a value
lies between 2 other values.
For example,
A <- ts(rnorm(120), freq=12, start=c(1992,8))
X <- 0.5
Y <- 0.8
I would like to create a new vector C for which C[i] is 0 if A[i] lies in
between X and Y.
Would be grate
Saptarshi Guha wrote:
Hello,
Suppose I have an expression, E, which accesses some variables present
in an environment V.
I do this via
eval(E,envir=V)
however all assignments end up in V. I would like the results of
assignments in E to end up in the .GlobalEnv ? Or at least the calling
environmen
Gundala Viswanath wrote:
Dear all,
In general practice one would slurp the whole file
using this method before processing the data:
dat <- read.table(filename)
or variations of it.
Is there a way we can access the file line by line
without slurping/storing them into object?
I am thinking som
Dear R users,
> I recently put a new version of my french introduction to R online. It
> is more specifically targeted at social sciences students and
> researchers, but could be interesting for beginners who are not
> really familiar with statistics and coding.
>
> The document is available (in f
Your panel function should have a ... argument: see the help page for
pairs(). Since your example is not 'self-contained' I cannot test this
out
On Sun, 4 Jan 2009, herwig wrote:
Hi there,
I am just starting in R and this might be a very basic question.
I applied one on the examples o
Version 2.4.0 of Rattle has been released to CRAN.
The rattle package (http://rattle.togaware.com) is a multi platform
(GNU/Linux, Mac/OSX, MS/Windows) GTK based GUI for data mining (for
exploring data and building descriptive and predictive models). It has
undergone a lot of development over the
56 matches
Mail list logo