Hello
I have a problem on keeping the format when I export a matrix file with the
write.table() function.
When I import the data volcano from rgl package it looks like this in R:
> data[1:5,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 100 100 101 1
I have a figure with a lattice plot and a basic plot. Is there a way to
select the color and line width of the surrounding boxes?
# Data
tC <- textConnection("
Time Type1 Type2 Type3
1.3 .50 .10 .40
4.5 .45 .20 .35
5.2 .40 .30 .30
")
data1 <- read.table(header=TRUE, tC)
data2 <- data.frame(Time=r
Glad to help -- I haven't taken a look at Dennis' solution (which may be far
better than mine), but if you do want to keep going down the path outlined
below you might consider the following:
Instead of throwing away a simulation if something starts negative, why not
just multiply the entire sampl
Greetings all,
I am calculating two t-test values for each of many files then save it
to file calculate another set and append, repeat.
But I can't figure out how to write it to file and then append
subsequent t-tests.
(maybe too tired ;} )
I have tried to use "dump" and "file.append" to no avial.
Hi Steve:
Very, very nice. Thanks for the useful Rcpp script. I'm not surprised
that a C++ version blows my humble little R function out of the water
:) I noticed that the R function ran a lot more slowly when the
sojourns were very long. It suggests that algorithms that entail
conditional iterati
Hi,
I haven't been following this thread very closely, but I'm getting the
impression that the "inner loop" that's killing you folks here looks
quite simple (assuming it is the one provided below).
How about trying to write the of this `f4` function below using the
rcpp/inline combo. The C/C++ yo
My advice to you is to get a 64-bit version of R. Here is what it
does on my 64-bit Windows 7 version:
> N<-250
> x<-matrix(c(rnorm(N,-1.5,1), rnorm(N,1,1), rbinom(N,1,0.5)), ncol=3)
> my.stats(1)
1 (1) - Rgui : 22:30:20 <0.7 78.6> 78.6 : 20.5MB
> start<-(-1)
> end<-3
> step<-10^(-2)
> n.steps<-(
Jim Silverton gmail.com> writes:
>
> Hello all,
> I am doing glm with a negative binomial link.
> I have two treatments and 3 replicates in each treatment. My question is
> this, how can I simulate data for the the columns from the null and
[alternative?]
> distribution.
>
Simulate from th
Em Domingo 31 Julho 2011, você escreveu:
> My memory is that this question gets asked every few months and one of
> the stock answers is to use the function 'package.skeleton' in the
> utils package as a starting point.
Got that from docs. And actually I already have most of the code written.
My
Hi:
See if this works for you:
f4 <- function()
{
x <- sample(c(-1L,1L), 1)
if (x >= 0 ) {return(1)} else {
csum <- x
len <- 1
while(csum < 0) {
csum <- csum + sample(c(-1, 1), 1)
len <- len + 1
On Sun, Jul 31, 2011 at 7:15 AM, Anthony Ching Ho Ng
wrote:
> Hello R-help,
>
> I wonder if it is possible to configure R, so that it will
> display/show the evaluation result of the R commands automatically
> (similar to the behavior of Matlab)
>
> i.e. If I type x <- 8
>
> it will print 8 in the
Am Mittwoch, den 27.07.2011, 19:59 -0400 schrieb R. Michael Weylandt :
> Some more skilled folks can help with the curve fitting, but the general
> answer is yes -- R will handle this quite ably.
Great to read that.
> Consider the following code:
>
> <<-->>
>
On 11-07-31 7:15 AM, Anthony Ching Ho Ng wrote:
Hello R-help,
I wonder if it is possible to configure R, so that it will
display/show the evaluation result of the R commands automatically
(similar to the behavior of Matlab)
It's open source so in theory anything is possible, but there's no
bu
On Jul 31, 2011, at 5:11 PM, Joshua Wiley wrote:
On Sun, Jul 31, 2011 at 2:05 PM, Alexandre Aguiar
wrote:
Hi,
I'd like to know whether there is a package (or more, of course)
regarded
as a good example that could be used also as an instructional tool
for
newcomers to R extensions develo
You could make three plots. The first two you plot in and the third
one you place the legend in.
nf<-layout(matrix(c(1,2,3), 1, 3, byrow = TRUE), c(6,6,3), c(6))
layout.show(nf)
plot(sin, -pi, 2*pi, col = "blue2")
plot(sin, -pi, 2*pi, col = "darkorange3")
plot(1, xlim=c(1,2), ylim=c(1,2), type=
Thanks for everyone's suggestions. I think looping is the way to go.
I have 50 files on which I need to apply the same procedures, so I'll
try and wrap my final code in some sort of loop.
> > highest and lowest groups)? (I can do this in multiple steps* but wonder
> > what the best, "R way" is
Hello all,
I am doing glm with a negative binomial link.
I have two treatments and 3 replicates in each treatment. My question is
this, how can I simulate data for the the columns from the null and
distribution.
--
Thanks,
Jim.
[[alternative HTML version deleted]]
I get the same on mine for the code below
sessionInfo()
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1]
LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C
I am slowly transferring things to a new computer when I found this
Snews post from Bill Venables - it comes in handy from time to time.
http://www.biostat.wustl.edu/archives/html/s-news/1999-09/msg00059.html
sin.cos.fcn <-
function(k, time) {
X <- matrix(0, length(time), 2*k)
I can confirm the " instead of ≤, using the default X11 device.
I use a Gentoo amd64 box, R-2.13.0.
Using ylab=expression("Prob[X" <= "x]") didn’t change things.
(The " might actually be a ″ (DOUBLE PRIME); it is hard to tell.)
OTOH, using a utf8-encoded ≤ works:
set.seed(6)
x<- rnorm(30, 100,
Am Sonntag, den 31.07.2011, 15:19 -0700 schrieb Jeffrey Dick:
> Here's an attempt using sapply:
>
> > x <- c(2, 2, 3, 3, 4, 6)
> > ys <- 1:8
> > sapply(ys, function(y) { length(which(x==y)) } )
> [1] 0 2 2 1 0 1 0 0
The last piece for my trials missing was `sapply()` which I overlooked
reading `?
Dear Sarah,
Am Sonntag, den 31.07.2011, 18:10 -0400 schrieb Sarah Goslee:
> I would use something like this:
>
> > x <- c(2,2,3,3,4,6)
> > table(x)
> x
> 2 3 4 6
> 2 2 1 1
> > x <- factor(x, levels=1:8)
> > table(x)
> x
> 1 2 3 4 5 6 7 8
> 0 2 2 1 0 1 0 0
awesome. Thank you.
Looking further I
See also ?tabulate.
tabulate(x,8)
> Hi Paul,
>
> I would use something like this:
>
>> x <- c(2,2,3,3,4,6)
>> table(x)
> x
> 2 3 4 6
> 2 2 1 1
>> x <- factor(x, levels=1:8)
>> table(x)
> x
> 1 2 3 4 5 6 7 8
> 0 2 2 1 0 1 0 0
>
> Sarah
>
> On Sun, Jul 31, 2011 at 5:41 PM, Paul Menzel
> wrote:
Here's an attempt using sapply:
> x <- c(2, 2, 3, 3, 4, 6)
> ys <- 1:8
> sapply(ys, function(y) { length(which(x==y)) } )
[1] 0 2 2 1 0 1 0 0
Jeff
On Sun, Jul 31, 2011 at 2:41 PM, Paul Menzel
wrote:
> Dear R folks,
>
>
> I am sorry to ask this simple question, but my search for the right
> way/
Both of these work on my system:
set.seed(6)
x <- rnorm(30, 100, 20)
xs <- seq(50, 150, length=150)
cdf <- pnorm(xs, 100, 20)
plot(xs, cdf, type='l', ylim=c(0,1),
xlab=expression(x),
ylab=expression(paste("Prob[", X <= x, "]"))) # FH
lines(ecdf(x), cex=.5)
plot(xs, cdf, type='l', ylim=c
Hi Paul,
I would use something like this:
> x <- c(2,2,3,3,4,6)
> table(x)
x
2 3 4 6
2 2 1 1
> x <- factor(x, levels=1:8)
> table(x)
x
1 2 3 4 5 6 7 8
0 2 2 1 0 1 0 0
Sarah
On Sun, Jul 31, 2011 at 5:41 PM, Paul Menzel
wrote:
> Dear R folks,
>
>
> I am sorry to ask this simple question, but my
I can help with a few questions:
Q) How to get means for "by" groups and subset a files based on those (subset
highest and lowest groups)? (I can do this in multiple steps* but wonder
what the best, "R way" is to do this.)
A) aggregate
Q) How to create a matrix of plots? (Take 4 separate plots a
Dear R folks,
I am sorry to ask this simple question, but my search for the right
way/command was unsuccessful.
I have a vector
> x <- c(2, 2, 3, 3, 4, 6)
Now the values of x should be considered the index of another vector
with possible greater length, say 8, and the value should be how often
Works also for me.
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8LC_COLLATE=fr_FR.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=fr_FR.UTF-8
[7] L
I found the thread starting
https://stat.ethz.ch/pipermail/r-help/2011-May/278063.html
simply by searching for your subject in the list archives (as the
posting guide suggested). Just how hard can this be?
On Sun, 31 Jul 2011, Thorsten Raff wrote:
Dear R-helpers,
this is just a notice to
Thorsten Raff med2.uni-kiel.de> writes:
> this is just a notice to inform everyone that the current versions of XML and
> odfWeave don't seem to be playing nice with each other.
> Since it took me quite some time to figure that out, I thought that I let you
> know. In my case it helped to inst
On Sun, Jul 31, 2011 at 2:05 PM, Alexandre Aguiar
wrote:
> Hi,
>
> I'd like to know whether there is a package (or more, of course) regarded
> as a good example that could be used also as an instructional tool for
> newcomers to R extensions development.
I used/use SoDA, but then I also used Dr.
Hi,
I'd like to know whether there is a package (or more, of course) regarded
as a good example that could be used also as an instructional tool for
newcomers to R extensions development.
Thanks.
--
Alexandre
--
Alexandre Santos Aguiar, MD, SCT
signature.asc
Description: This is a digita
Hi R Student,
On Sun, Jul 31, 2011 at 10:57 AM, r student wrote:
> I'm wondering if anyone can give some basic advice about how to approach a
> specific task in R.
>
> I'm new to R but have used SAS for many years, and while I can muscle
> through a lot of the code details, I'm unsure of a few th
Loops, as in any program language, are sometimes unavoidable but this is
rarely the case in R. If you have any experience with MATLAB or similar
software, you know the importance of working vectorwise and the same
principles apply to R. For instance, if I wanted a list of all the squares
of numbers
Hello,
I have two plots on the same screen. I use the command par(mfrow=c(1,2)) in
order to do this. When I try to make a legend for both plots, it only puts
the legend in the plot on the right side. If I would like a legend that is
outside of both of the plots, how would I do this?
Thanks
I need to use entropy based feature selection to reduce term space while
doing text classification. Are there any R packages available that would
help me do this?
I can also make do with chi squared based algorithm, if there are packages
for that.
Thanks in advance.
Andy
--
View this message in
I'm wondering if anyone can give some basic advice about how to approach a
specific task in R.
I'm new to R but have used SAS for many years, and while I can muscle
through a lot of the code details, I'm unsure of a few things.
Specific questions:
If I have to perform a set of actions on a grou
Dear all,
I am trying to make some matrix operations (whose size I think is smaller
than what R allows) but the operations are not feasible when they run in one
session but it is feasible if they run separately while each operation is
totally independent of the other. I run the code in one session
Thanks very much everybody.
I'm going to try all the options and tell you
-
Mario Garrido Escudero
PhD student
Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola
Universidad de Salamanca
--
View this message in context:
http://r.789695.n4.nabble.com/R-in-Linux-Ubunt
Dear R-helpers,
this is just a notice to inform everyone that the current versions of XML and
odfWeave don't seem to be playing nice with each other.
Since it took me quite some time to figure that out, I thought that I let you
know. In my case it helped to install an older version of XML but y
Thanks
Pscl seems to be a sensible option.
I have the counts variable with the name "N". This variable can only take
values bigger than zero!
I have two explanatory variables with the names "type" and "diam"
but when I run
hpm <- hurdle(n ~ type+diam, data = an, dist = "poisson")
I get th
Frank Harrell vanderbilt.edu> writes:
>
> Under
>
> platform x86_64-pc-linux-gnu
> arch x86_64
> os linux-gnu
> system x86_64, linux-gnu
> status
> major
On 2011-07-31 11:25, Frank Harrell wrote:
Under
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 2
minor 13.1
year 2011
month 07
day08
svn rev56322
language
Thank you all for the ideas
Dr. Iasonas Lamprianou
Department of Social and Political Sciences
University of Cyprus
>
>From: Mitchell Maltenfort
>To: Iasonas Lamprianou ; "r-help@r-project.org"
>
>Sent: Sunday, 31 July 2011, 20:45
>Subject: Re: [R] zero trunca
Dear responders,
thank you very much for all your answers, suggestions and corrections. I
will try to give feedback and share my findings.
Am Donnerstag, den 28.07.2011, 01:56 + schrieb William Dunlap:
[…]
> You might try using sample(c(-1,1), size=length, replace=TRUE)
> instead of sign(r
Mitchell Maltenfort gmail.com> writes:
>
> Pscl package.
>
I'm not sure pscl will do zero-truncated (alone, as opposed to
as part of a hurdle model) regression. countreg (on r-forge),
as pointed out in the previous response, should work. Also
see ?Pospois in the VGAM package, or define your
Michael,
Got it, thanks. Looking over the man file realized it is FLAG not flat.
Cheers,
M
On Sun, Jul 31, 2011 at 2:26 PM, Matt Curcio wrote:
> Hmmm...
> Got this error
>
> Error in formatC(i, width = 4, format = "d", flat = "0") :
> unused argument(s) (flat = "0")
>
> Any ideas,
> M
>
> On Su
Sorry, a typo on my end: argument is flag, not flat...
On Jul 31, 2011, at 1:26 PM, Matt Curcio wrote:
> Hmmm...
> Got this error
>
> Error in formatC(i, width = 4, format = "d", flat = "0") :
> unused argument(s) (flat = "0")
>
> Any ideas,
> M
>
> On Sun, Jul 31, 2011 at 1:30 PM, Matt Curc
Hmmm...
Got this error
Error in formatC(i, width = 4, format = "d", flat = "0") :
unused argument(s) (flat = "0")
Any ideas,
M
On Sun, Jul 31, 2011 at 1:30 PM, Matt Curcio wrote:
> Greetings all,
> I would like to append a 4 digit number suffix to the names of my
> files for later use. What
Under
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 2
minor 13.1
See ?sprintf (and/or search the web for sprintf), e.g.
filename <- sprintf("kegg.subrichcdt.%04d.txt", i)
/Henrik
On Sun, Jul 31, 2011 at 10:30 AM, Matt Curcio wrote:
> Greetings all,
> I would like to append a 4 digit number suffix to the names of my
> files for later use. What I am using now
Hi,
On Sun, Jul 31, 2011 at 1:04 PM, Alex Zhang wrote:
> Steve,
> Thank you very much for your response.
> The method you suggested definitely helps. But the "myfun" I gave is just a
> dummy function to show the problem. In some parts of the work I have at hand
> right now, I do need the datafram
It might be more efficient to do the following though:
i = 1:1000
fileNames =
paste("kegg.subrichcdt.",formatC(i,width=4,format="d",flat="0"),".txt",sep="")
So you now only have one vector containing all the names: then
for (i in 1:1000) {
temp = ## WHATEVER MAKES TEMP
write.table(temp,file = f
I think this will do it:
formatC(i,width=4,format="d",flag="0")
Michael Weylandt
On Sun, Jul 31, 2011 at 12:30 PM, Matt Curcio wrote:
> Greetings all,
> I would like to append a 4 digit number suffix to the names of my
> files for later use. What I am using now only produces 1 or 2 or 3 or
>
Pscl package.
On 7/31/11, Iasonas Lamprianou wrote:
> Dear friends,
>
> does anyone know how I can run a zero truncated poisson regression using R
> (or even SPSS)?
>
> Dr. Iasonas Lamprianou
> Department of Social and Political Sciences
> University of Cyprus
>
> [[alternative HTML version
On Jul 31, 2011, at 12:59 PM, Iasonas Lamprianou wrote:
Dear friends,
does anyone know how I can run a zero truncated poisson regression
using R (or even SPSS)?
A bit of searching produces:
https://stat.ethz.ch/pipermail/r-help/2011-March/270614.html
--
David Winsemius, MD
West Hartford
Greetings all,
I would like to append a 4 digit number suffix to the names of my
files for later use. What I am using now only produces 1 or 2 or 3 or
4 digits.
for (i in 1:1000) {
temp <- (kegg [i,])
temp <- merge (temp, subrichcdt, by="gene")
file.name <- paste ("kegg.s
On Sun, 31 Jul 2011, Joshua Wiley wrote:
On Sun, Jul 31, 2011 at 9:00 AM, David Winsemius wrote:
On Jul 31, 2011, at 11:51 AM, Ista Zahn wrote:
Hi Michael,
The easiest thing to do is just install the source package with
install.packages("p3d", repos="http://R-Forge.R-project.org";, type =
Steve,
Thank you very much for your response.
The method you suggested definitely helps. But the "myfun" I gave is just a
dummy function to show the problem. In some parts of the work I have at hand
right now, I do need the dataframe structure (i.e. all.data) to be inside of
the function becau
Dear friends,
does anyone know how I can run a zero truncated poisson regression using R (or
even SPSS)?
Dr. Iasonas Lamprianou
Department of Social and Political Sciences
University of Cyprus
[[alternative HTML version deleted]]
__
R-help@
Thanks to all who replied to this. I do have the Windows tool set, and
none of these packages required
fancy stuff, or contained compiled code, so install.packages(...,
type="source") was an effective one-time solution.
Still, David has, I think, found the source of the problem I encountered:
Hi,
On Sun, Jul 31, 2011 at 12:30 PM, Alex Zhang wrote:
> Dear all,
>
> I am having a problem with mapply. I guess the reason is that mapply is not
> "vectorized". But could you please take a look at my code below and help me
> to find a solution (either a better way to use mapply or a differen
Dear all,
I am having a problem with mapply. I guess the reason is that mapply is not
"vectorized". But could you please take a look at my code below and help me to
find a solution (either a better way to use mapply or a different function to
call). Thanks a lot!
##beginning of my code
myfun
On Sun, Jul 31, 2011 at 12:14 PM, Joshua Wiley wrote:
> On Sun, Jul 31, 2011 at 9:00 AM, David Winsemius
> wrote:
>>
>> On Jul 31, 2011, at 11:51 AM, Ista Zahn wrote:
>>
>>> Hi Michael,
>>> The easiest thing to do is just install the source package with
>>>
>>> install.packages("p3d", repos="htt
On Sun, Jul 31, 2011 at 9:00 AM, David Winsemius wrote:
>
> On Jul 31, 2011, at 11:51 AM, Ista Zahn wrote:
>
>> Hi Michael,
>> The easiest thing to do is just install the source package with
>>
>> install.packages("p3d", repos="http://R-Forge.R-project.org";, type =
>> "source")
>>
>> You'll need
On Jul 31, 2011, at 11:51 AM, Ista Zahn wrote:
Hi Michael,
The easiest thing to do is just install the source package with
install.packages("p3d", repos="http://R-Forge.R-project.org";, type =
"source")
You'll need install some prerequisite software first (if you've not
already done so). S
On Jul 31, 2011, at 11:26 AM, Michael Friendly wrote:
[Env: Win XP]
I've just upgraded from R 2.12.2 to R 2.13.1. As part of my upgrade
process, I typically install some in-development
packages from R-Forge that are not on cran. But for the first time,
it
doesn't work.
e.g.,
install.pack
Hi Michael,
The easiest thing to do is just install the source package with
install.packages("p3d", repos="http://R-Forge.R-project.org";, type = "source")
You'll need install some prerequisite software first (if you've not
already done so). See
http://cran.r-project.org/doc/manuals/R-admin.html#
[Env: Win XP]
I've just upgraded from R 2.12.2 to R 2.13.1. As part of my upgrade
process, I typically install some in-development
packages from R-Forge that are not on cran. But for the first time, it
doesn't work.
e.g.,
> install.packages("p3d", repos="http://R-Forge.R-project.org";)
trying
Hi,
It *looks* to me like those are just 1 - criterion (from what is
printed). I did not see a nice way to extract them manually. Here is
what I did:
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq,
controls = ctree_control(maxsurrogate = 3))
round(1 - airct@t
I have run the ctree function, and my dependent variable is broken into 3
categories: low cost, moderate cost and high cost.
When i plot the results (eg. using plot(test.ct)), the plot shows, at the
very bottom of each node, the probability of falling into each cost
category.
I haven't seen an answer yet, so I'll give it a shot (below).
On 2011-07-29 01:37, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote:
Dear all,
Quite often I have the situation that I've multiple response variables
and I create Linear Models for them in a function. The following code
illustrat
Hello,
I can recommend Rkward. I use it and I'm fully satisfied with it. There is
nice menu (You can "click" most of needed functions, load packages, ...),
sheets with Your data, terminal with debugger and so on... Really good tool.
Best regards,
Vojtěch
-
Vojtěch Zeisek
Department of Botany,
> h <- taskCallbackManager()
> h$add(function(expr, value, ok, visible) {if(!visible){print(value)};TRUE})
On Sun, Jul 31, 2011 at 12:15 PM, Anthony Ching Ho Ng
wrote:
> Hello R-help,
>
> I wonder if it is possible to configure R, so that it will
> display/show the evaluation result of the R com
Hello R-help,
I wonder if it is possible to configure R, so that it will
display/show the evaluation result of the R commands automatically
(similar to the behavior of Matlab)
i.e. If I type x <- 8
it will print 8 in the command prompt, instead of having type x
explicitly to show the result and
Thanks Duncan. Sorry for the ambiguityI'd like to write my own package
to enhance it by adding the possibility to handle the additional
distribution. My question was more about the programming that needs to be
done (so I'll write the package maintainer for that). However, I'm similarly
interest
Wir sind bis am 20. August in den Ferien und werden keine e-mails beantworten.
Bei dringenden Fällen melden Sie sich bei Stefanie von Felten
steffi.vonfel...@oikostat.ch
We are on vacation until 20. August. In urgent cases, please contact Stefanie
von Felten steffi.vonfel...@oikostat.ch
__
78 matches
Mail list logo