Barry Rowlingson wrote:
[...]
>>> Yes, you can probably vectorize this with lapply or something, but I
>>> prefer clarity over concision when dealing with beginners...
>>>
>> but where's the preferred clarity in the for loop solution?
>>
>
> Seriously? You think:
>
> lapply(1:n, rno
Homework? - see your instructor! Otherwise, provide minimal self-contained
code and show us where you are stuck.
-
cuncta stricte discussurus
-
-Ursprüngliche Nachricht-
Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Barry Rowlingson wrote:
> On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk
> wrote:
>
>> Barry Rowlingson wrote:
>>
>
>
>>n = 1000
>>benchmark(columns=c('test', 'elapsed'), order=NULL,
>> 'for'={ l = list(); for (i in 1:n) l[[i]] = rnorm(i, 0, 1) },
>> lapply=lappl
On Thu, May 14, 2009 at 2:16 PM, christiaan pauw wrote:
> Hi everybody.
> I want to identify not only duplicate number but also the original number
> that has been duplicated.
> Example:
> x=c(1,2,3,4,4,5,6,7,8,9)
> y=duplicated(x)
> rbind(x,y)
>
> gives:
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,
On Wednesday 13 May 2009 10:54:01 pm Peverall Dubois wrote:
> Hi,
>
> Suppose I have a calculation that contain an estimation
> of certain value and its confidence interval
> (this is computed via Chi Square approximation).
>
> Is there any approach in R in which we can
> evaluate the confidence in
Hi everybody.
I want to identify not only duplicate number but also the original number
that has been duplicated.
Example:
x=c(1,2,3,4,4,5,6,7,8,9)
y=duplicated(x)
rbind(x,y)
gives:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
x123445678 9
y0
I want generate R code to determine the real root of the polynomial
x^3-2*x^2+3*x-5. Using an initial guess of 1 with Newton's method.
Help please...
--
View this message in context:
http://www.nabble.com/Finding-root-using-Newton%27s-method-tp23534519p23534519.html
Sent from the R help mailing
Hi, postscript should do, "*.eps" specifically.
x=rnorm(100,0,1)
e=rnorm(100,0,1)
y=x+e
postscript("myeps.eps")
plot(y~x)
dev.off()
Cheers,
Daniel
-
cuncta stricte discussurus
-
-Ursprüngliche Nachricht-
Von: r-help-boun...@r-project.or
Wacek Kusnierczyk wrote:
Barry Rowlingson wrote:
On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk
wrote:
Barry Rowlingson wrote:
Soln - "for" loop:
> z=list()
> for(i in 1:1000){z[[i]]=rnorm(100,0,1)}
now inspect the individual bits:
> hist(z[[1]])
> hist(z[[545]])
If that's the pr
Hi
What you need to do is to specify where your plots are going on the page.
This can depend on the graphics package used
To start you going if you are using the base graphics:- plot etc see ?layout
For lattice see ?viewports for a start.
HTH
Duncan Mackay
Department of Agronomy and Soil Scie
Hi,
Suppose I have a calculation that contain an estimation
of certain value and its confidence interval
(this is computed via Chi Square approximation).
Is there any approach in R in which we can
evaluate the confidence interval?
- GV
__
R-help@r-pro
Dear colleagues,
Saving a plot with pdf gives a very nice result:
pdf("myplot.pdf")
par(font=1,family='serif')
plot(pressure)
dev.off()
Doing the very same with other formats (png, jpeg, tiff) gives far
worse results. Is there anything to do to make a plot in some other
format than pdf look like
Hi,
Thank you for your reply.
This is exactly what I have done.
However, I would like to get the two plots next to each other (to use as one
figure).
At the moment the two plots are on two different pages.
my ps is set as:
postscript(file = "myRplot.ps",bg="transparent",pointsize=1.0,
Hi All,
Thankyou for your sugestions,
I Look through some other posts and learnt about the
persp() function.
So I ended up using;
x <- seq(0, 1, len = 20)
y <- seq(0, 1, len = 20)
model = function (x, y){
x+y}
z=outer(x, y ,model);
persp(x,y,z,theta=30,phi=30,ticktype="detailed")
Worked a rea
On Tuesday 12 May 2009 02:59:30 pm Mark Na wrote:
> H R-helpers,
>
...
>
> One column (several, actually) in the spreadsheet contains integers in
> its first few rows but later values in these columns contain a mixture
> of numbers, letters and symbols (it's an ID variable, containing e.g.,
> 12, 1
Tom Schenk Jr wrote:
I use RODBC as my conduit from R to SQL. It works well when the tables are
stored on one channel, e.g.,
channel <- odbcConnect("data_base_01", uid="", dsn="")
However, I often need to match tables across multiple databases, e.g.,
"data_base_01" and "data_base_02". H
Robert A LaBudde wrote:
>
> At 05:49 PM 5/13/2009, Rob Knell wrote:
>>People
>>
>>I apologise for asking a general stats question, but I'm at a bit of a
>>loss as to what to do following some hostile referees' comments. If I
>>have a fully randomised blocked design, with only three blocks, shou
There are quite a few others. See:
http://cran.r-project.org/web/views/ExperimentalDesign.html
On May 12, 2009, at 7:44 PM, Chris Howden wrote:
> I've spent the last week or so looking at all the experimental design
> packages I can find in R. AlgDesign, design.conf and BHH2 being the
> best o
Does anyone have any suggestion on this? I tried par(new="T") It does not seem
to work with scatterplot3d. Any suggestion is appreciated.
Cheers../Murli
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Nair, Murlidharan T
Sent: Wed
You have the arguments out of line and you need two backslashes:
> x <- "wa.w"
> gsub("\\..*", "", x)
[1] "wa"
>
Bill Venables
http://www.cmis.csiro.au/bill.venables/
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Stephen J.
hi,
Excuse me asking three questions in a row for a day, but I had
collected those questions
as I'm still experimenting with R.
This one is how do you compose plots with alot of data in one graph.
First what I currently do is after i generated all the data I need to
plot.. let say 5-6 arrays
I do
On 13-May-09 23:47:41, Henrique Dallazuanna wrote:
> Try this:
>
> gsub("^(\\w*).*$", "\\1", x)
Even simpler:
x
# [1] "wa.w"
gsub("\\..*","",x,perl=TRUE)
# [1] "wa"
x<-"abcde.fghij.klmno"
gsub("\\..*","",x,perl=TRUE)
# [1] "abcde"
(and it doesn't matter whether 'perl' is TRUE or FALSE)
R interprets backslash to give special meaning to the next character, i.e.
it strips off the backslash and send the following character to gsub
possibly reinterpreting it specially (for example \n is newline). Thus
a backslash will never get to gsub unless you use a double backslash.
Thus we can u
Try this:
gsub("^(\\w*).*$", "\\1", x)
On Wed, May 13, 2009 at 8:41 PM, Stephen J. Barr wrote:
> Hello,
>
> I have several strings where I am trying to eliminate the period and
> everything after the period, using a regular expression. However, I am
> having trouble getting this to work.
>
> > x
Hello,
I have several strings where I am trying to eliminate the period and
everything after the period, using a regular expression. However, I am
having trouble getting this to work.
> x = "wa.w"
> gsub(x, "\..*", "", perl=TRUE)
[1] ""
Warning messages:
1: '\.' is an unrecognized escape in a cha
In S3 you pass the object as the first argument of the method (rather than
prefixing the method with the object as is common in other languages).
When you call a method you write
method(obj, ...whatever...) # correct
and it automatically inspect the class of obj and if its class is Blah
then it d
I found a tutorial for creating classes using generic functions ? S3
way ! It was short description so I couldn't grok in full its
usage ... So far so good, what i currently do is something like this :
Blah <- function(data,...) UseMethod('Blah')
Blah.default <- function( .. ) {
self = ..
There is a one line nextfri function defined in the zoo-quickref
vignette and replacing 5 with 1 in its definition will give you next
Monday. The prior Monday is 7 days before that so take the
closest of the two. See R News 4/1 for more about dates.
On Wed, May 13, 2009 at 4:23 PM, myshare wro
On Wed, May 13, 2009 at 4:23 PM, myshare wrote:
> hi,
>
> I have a and data frame with date-column and some other columns.
> My first question is what is the fastest way to get the index of an
> array if I know the value f.e
>
> > x = c(4,5,6,7,8)
>
> so i know the value is 6.. i.e. the index is
On 14/05/2009, at 10:04 AM, Carl Witthoft wrote:
So far nobody seems to have warned the OP about seeding.
Presumably Debbie wants 1000 different sets of samples, but as we all
know there are ways to get the same sequence (initial seed) every
time.
If there's a starting seed for one of the
Hello.
I am trying to optimize a set of parameters using /optim/ in which the
actual function to be minimized contains matrix multiplication and is of
the form:
SUM ((A%*%X - B)^2)
where A is a matrix and X and B are vectors, with X as parameter vector.
This has worked well so far. Recently, I
At 05:49 PM 5/13/2009, Rob Knell wrote:
People
I apologise for asking a general stats question, but I'm at a bit of a
loss as to what to do following some hostile referees' comments. If I
have a fully randomised blocked design, with only three blocks, should
I treat block as a random or fixed ef
On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk
wrote:
> Barry Rowlingson wrote:
> n = 1000
> benchmark(columns=c('test', 'elapsed'), order=NULL,
> 'for'={ l = list(); for (i in 1:n) l[[i]] = rnorm(i, 0, 1) },
> lapply=lapply(1:n, rnorm, 0, 1) )
> # test elapsed
> #
So far nobody seems to have warned the OP about seeding.
Presumably Debbie wants 1000 different sets of samples, but as we all
know there are ways to get the same sequence (initial seed) every time.
If there's a starting seed for one of the "generate a single giant
matrix" methods proposed, t
I use RODBC as my conduit from R to SQL. It works well when the tables are
stored on one channel, e.g.,
channel <- odbcConnect("data_base_01", uid="", dsn="")
However, I often need to match tables across multiple databases, e.g.,
"data_base_01" and "data_base_02". However, odbcConnect() a
People
I apologise for asking a general stats question, but I'm at a bit of a
loss as to what to do following some hostile referees' comments. If I
have a fully randomised blocked design, with only three blocks, should
I treat block as a random or fixed effect? I have read comments about
Hi R People:
I have a question about setClass please. I'm working thru "R
Programming for Bioinformatics".
Actually, I was wondering if there is such a thing as an updateClass,
in order to change a "contains" option, please?
that is, if I had
setClass("dog",
representation(name="character",paw
Try using the subplot function from the TeachingDemos package.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> projec
AG wrote:
Hello all
I am looking to learn R and was thumbing through volume 1 of "R
reference manual - Base Package". I'm sorry if this is ludicrously
silly to ask, but is this book worth the investment as a good way to
learn how to use R?
AG
_
Barry Rowlingson wrote:
> On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk
> wrote:
>> Barry Rowlingson wrote:
>
>>> Soln - "for" loop:
>>>
>>> > z=list()
>>> > for(i in 1:1000){z[[i]]=rnorm(100,0,1)}
>>>
>>> now inspect the individual bits:
>>>
>>> > hist(z[[1]])
>>> > hist(z[[545]])
>>>
>
Hello all
I am looking to learn R and was thumbing through volume 1 of "R
reference manual - Base Package". I'm sorry if this is ludicrously
silly to ask, but is this book worth the investment as a good way to
learn how to use R?
AG
__
R-help@r-
By popular demand, XLSolutions has scheduled second back2back courses
in New York City, San Francisco, Boston, Washington DC,
Seattle and Salt Lake City. Taught by top R/S+ gurus!
This is a second in our 9 years of teaching R/Splus Courses.
West Coast<---back2back---> East Coast
(1) R/S-
Thanks, Martin!
...Tao
> From: maech...@stat.math.ethz.ch
> Date: Wed, 13 May 2009 14:13:48 +0200
> To: shi...@hotmail.com
> CC: rip...@stats.ox.ac.uk; bcarv...@jhsph.edu; r-help@r-project.org;
> maech...@stat.math.ethz.ch
> Subject: Re: [R] silhouette: clustering labels have to be consecutive
Steve Sidney wrote:
Hi Luc
Many thanks for the suggestions.
I will take a look at them as soon as I can.
Are the functions standard or are they part of a function and if so
which one?
Regards
Steve
- Original Message - From: "Luc Villandre"
To: "Steve Sidney"
Cc:
Sent: Wednesda
Hi Luc
Many thanks for the suggestions.
I will take a look at them as soon as I can.
Are the functions standard or are they part of a function and if so which
one?
Regards
Steve
- Original Message -
From: "Luc Villandre"
To: "Steve Sidney"
Cc:
Sent: Wednesday, May 13, 2009 10:10
hi,
I have a and data frame with date-column and some other columns.
My first question is what is the fastest way to get the index of an
array if I know the value f.e
> x = c(4,5,6,7,8)
so i know the value is 6.. i.e. the index is 3. What I currently do is
loop over the array, I was thinking if
On 13-May-09 19:49:35, Steve Sidney wrote:
> Dear list
> I have managed to write a short program to evaluate data which is
> inputted from a csv file using the following
>
> x = read.csv("wms_results.csv", header=TRUE)
>
> All works fine but since I have a number of similar data files which
> hav
Hi useR's,
I want to overlay an image plot over a world map and I can do it, but just
not the way I need to do it. Here is the code I am using (with data file
attached) to create my baseline map:
library(sp)
load("TM_WORLD_BORDERS_SIMPL-0.2.RData")
par(bty="l")
plot(wrld_simpl, axes = TRUE, ylim
Steve Sidney wrote:
Dear list
I have managed to write a short program to evaluate data which is
inputted
from a csv file using the following
x = read.csv("wms_results.csv", header=TRUE)
All works fine but since I have a number of similar data files which have
different names, I would like th
Did you try putting
library("your-package-name", char=TRUE)
at the start of the examples?
-- Tony Plate
Rebecca Sela wrote:
I am creating an R package. I ran R CMD check on the package, and everything
passed until it tried to run the examples. Then, the result was:
* checking examples ..
Dear list
I have managed to write a short program to evaluate data which is inputted
from a csv file using the following
x = read.csv("wms_results.csv", header=TRUE)
All works fine but since I have a number of similar data files which have
different names, I would like the program to allow me t
Hi!!
I am interested in plotting 3 different (x,y,z) coordinate sets on the same
plot. How do I achieve using scatterplot3d?
Is there an easy method to call to change the projection or rotate the figure
along a particular axis? The following is the code that plots if one at a
time. Any help i
To see what's available in other packages, try the following:
library(RSiteSearch)
AFT <- RSiteSearch.function('AFT model')
summary(AFT) # 24 help files found in 8 different packages
HTML(AFT) # opens a table with 24 rows in a web browser.
There may be nothing here that will help you,
Dear R group,
Simple anova question:
I am attempting to recreate a figure (from chapter 10 of "Mordern Statistics
for the Life Sciences", chapter 10, figure 10.8).
It is an interaction diagram plotting BYIELD (continuous) as a function of
BSPACING (categorical) with different lines/colours for an
Here is a response to almost exactly the same question from a couple of weeks
ago:
http://finzi.psych.upenn.edu/R/Rhelp08/2009-April/196967.html
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> F
Dear useRs,
I've been trying to run a Mann-Kendall test in my data in order to detect
trends.
I studied the examples given at the Kendall package and I can understand pretty
well how it works on time-series data.
However, my data consists of values in different sites per year, as I display
belo
Take a look at this article on CodeProject:
http://www.codeproject.com/KB/cs/RtoCSharp.aspx
Cheers,
Dave
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Arun Kumar Saha
Sent: Wednesday, May 13, 2009 10:33 AM
To: r-h...@stat.math.e
Can anyone see what I'm doing wrong here (highlighted below)? This is driving
me crazy... probably a ')' or something equally moronic...
> genw1[,1]
A2 A3 A5 A7 A9 A00010 A00012 A00013 A00014 A00015 A00017
A00018 A00019 A00021 A00023 A00024
CC CC CC CC CC
I am creating an R package. I ran R CMD check on the package, and everything
passed until it tried to run the examples. Then, the result was:
* checking examples ... ERROR
Running examples in REEMtree-Ex.R failed.
The error most likely occurred in:
> ### * AutoCorrelationLRtest
>
> flush(stde
On Wed, 2009-05-13 at 12:43 -0400, stephen sefick wrote:
> melt.updn <- structure(list(date = structure(c(11808, 11869, 11961, 11992,
> 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
> 13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418,
> 12600, 12631, 12753, 12996, 13057
On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk
wrote:
> Barry Rowlingson wrote:
>> Soln - "for" loop:
>>
>> > z=list()
>> > for(i in 1:1000){z[[i]]=rnorm(100,0,1)}
>>
>> now inspect the individual bits:
>>
>> > hist(z[[1]])
>> > hist(z[[545]])
>>
>> If that's the problem, then I suggest
Hi, Currently I am a .net programmer and would like to use R for my
statistical computations engine. I already have installed RServer250.exe so
that I could call R from my .net programming environment, however
unfortunately, i could not be able to find RServer250.exe in the R-(D) COM
Interface reg
On Wed, 2009-05-13 at 11:22 +0200, Uwe Ligges wrote:
> If not, example:
>
> par(mfrow = c(2,3), mar = c(0,0,0,0), oma = c(5,5,0,0), xpd=NA)
> plot(1, xaxt="n", xlab="", ylab="A")
> plot(1, xaxt="n", yaxt="n", xlab="", ylab="")
> plot(1, xaxt="n", yaxt="n", xlab="", ylab="")
> plot(1, xlab="I", yla
melt.updn <- structure(list(date = structure(c(11808, 11869, 11961, 11992,
12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418,
12600, 12631, 12753, 12996, 13057, 13149), class = "Date"), variable =
structure(c(1L,
1L, 1L, 1L,
You can automate this step
>key[key == "AT"] <- "TA"
## create a function to reverse a string -- see strsplit help page for this
strReverse function
reverse <- function(x) sapply(lapply(strsplit(x, NULL), rev), paste,
collapse="")
key <- rownames(a)
# combine rownames with reverse (rownames)
n<-
Benoit Boulinguiez ensc-rennes.fr> writes:
> I try to assess the parameters (K1,K2) of a model that describes the
> adsorption of a molecule onto on adsorbent.
>
> equation: dq/dt = K1*C*(qm-q)-K2*q
>
> I know the value of 'qm' and I experimentally measure the variables 'q',
> 'C', and the time
Barry Rowlingson wrote:
> On Wed, May 13, 2009 at 4:26 PM, Gábor Csárdi wrote:
>
>> On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote:
>>
>>> Dear R users,
>>>
>>> Can anyone please tell me how to generate a large number of samples in R,
>>> given certain distribution and size.
>>>
>>>
Good Day to All,
When sweaving the following:
\begin{table}
\centering
<>=
ftable(ifmtm$type, ifmtm$gender, ifmtm$marche , ifmtm$nfic,
dnn=c("Type","Gender","Ambulant","Visit"))
@
\caption{Four-way cross-tabulation on all data}
\label{tab:crosstab}
\end{table}
the output of ftable is not centere
Try the rSymPy or Ryacas packages.
In the rSymPy code below the var command defines x
as symbolic to sympy and then we perform the
computation:
> library(rSymPy)
Loading required package: rJava
> sympy("var('x')")
[1] "x"
> sympy("limit(x*x + x + 2, x, 2)")
[1] "8"
Or using devel version define
Hi all,
I try to assess the parameters (K1,K2) of a model that describes the
adsorption of a molecule onto on adsorbent.
equation: dq/dt = K1*C*(qm-q)-K2*q
I know the value of 'qm' and I experimentally measure the variables 'q',
'C', and the time 't'.
t C q
1 0 144.0
Does every 100 numbers in rnorm(100 * 1000, 0, 1) have the N(0,1) distribution?
On Wed, May 13, 2009 at 11:13 PM, Debbie Zhang wrote:
>
>
> Dear R users,
>
> Can anyone please tell me how to generate a large number of samples in R,
> given certain distribution and size.
>
> For example, if I wan
On 13-May-09 15:18:05, Debbie Zhang wrote:
> Dear R users,
> Can anyone please tell me how to generate a large number of samples in
> R, given certain distribution and size.
> For example, if I want to generate 1000 samples of size n=100, with a
> N(0,1) distribution, how should I proceed?
> (Sinc
To all of you who answered me: Thank you so much!
Each approach taught me something new and I really appreciate your help!
Best regards,
Dana Sevak
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
Dear Debbie,
Here are two options:
# Parameters
N <- 1000
n <- 100
# Option 1
mys <- replicate(N, rnorm(n))
mys
# Option 2
mys2 <- matrix(rnorm(N*n),ncol=N)
mys2
HTH,
Jorge
On Wed, May 13, 2009 at 11:13 AM, Debbie Zhang wrote:
>
>
> Dear R users,
>
> Can anyone please tell me how to generat
On Wed, May 13, 2009 at 4:26 PM, Gábor Csárdi wrote:
> On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote:
>>
>>
>> Dear R users,
>>
>> Can anyone please tell me how to generate a large number of samples in R,
>> given certain distribution and size.
>>
>> For example, if I want to generate 1000
Uwe Ligges wrote:
> So you want some software that can do symbolic calculations? In that
> case use other software. R is designed for numerical analyses.
In particular, if you are looking for good free software, you
might try Maxima.
--
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed ar
If you want k samples of size n, why generate k*n samples and put them
in a k-by-n matrix where you can do what you want to each sample:
k = 10
n = 100
x=matrix(rnorm(k*n),k,n)
rowMeans(x)
If you need to do more complex things to each sample and if k is large
enough that you don't want the matrix
what about putting in a matrix, e.g.,
matrix(rnorm(1000*100), 1000, 100)
I hope it helps.
Best,
Dimitris
Debbie Zhang wrote:
Dear R users,
Can anyone please tell me how to generate a large number of samples in R, given
certain distribution and size.
For example, if I want to generate 10
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Debbie Zhang
> Sent: Wednesday, May 13, 2009 8:18 AM
> To: r-help@r-project.org
> Subject: [R] Problems with randomly generating samples
>
>
> Dear R users,
> Can anyone please t
On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang wrote:
>
>
> Dear R users,
>
> Can anyone please tell me how to generate a large number of samples in R,
> given certain distribution and size.
>
> For example, if I want to generate 1000 samples of size n=100, with a N(0,1)
> distribution, how shoul
Dear R users,
Can anyone please tell me how to generate a large number of samples in R, given
certain distribution and size.
For example, if I want to generate 1000 samples of size n=100, with a N(0,1)
distribution, how should I proceed?
(Since I dont want to do "rnorm(100,0,1)" in R for 1000 t
Dear R users,
Can anyone please tell me how to generate a large number of samples in R, given
certain distribution and size.
For example, if I want to generate 1000 samples of size n=100, with a N(0,1)
distribution, how should I proceed?
(Since I dont want to do "rnorm(100,0,1)" in R for 10
A few points to consider:
- If all the data are numeric, then use matrices instead of data frames.
- With either data frames or matrices, there is no way (that I'm aware
of anyway) in R to stack them without making at least one copy in
memory.
- Since none of the files has a header row, I would
On 13-May-09 14:43:17, Gabor Grothendieck wrote:
>> out <- apply(m, 1, cat, '\n')
> 1 3
> 2 4
>> out
> NULL
Or, more explicitly, from ?cat :
Value:
None (invisible 'NULL').
Ted.
> On Wed, May 13, 2009 at 5:23 AM, Wacek Kusnierczyk
> wrote:
>> _ _m = matrix(1:4, 2)
>>
>> _ _apply(m,
Hi all,
I am doing some explorations using a dataset with the following
structure (id, value, flag).
For instance:
a, 2.2, 1
b, 3.0, 1
c, 2.9, 0
d, 3.1, 1
...
I have plotted a standard histogram using a simple command like:
hist(data$value)
My question:
I would like to superimpose a line ([0%-
Hi all,
I am doing some explorations using a dataset with the following
structure (id, value, flag).
For instance:
a, 2.2, 1
b, 3.0, 1
c, 2.9, 0
d, 3.1, 1
...
I have plotted a standard histogram using a simple command like:
hist(data$value)
My question:
I would like to superimpose a line ([0%-
> out <- apply(m, 1, cat, '\n')
1 3
2 4
> out
NULL
On Wed, May 13, 2009 at 5:23 AM, Wacek Kusnierczyk
wrote:
> m = matrix(1:4, 2)
>
> apply(m, 1, cat, '\n')
> # 1 2
> # 3 4
> # NULL
>
> why the null?
>
> vQ
>
> __
> R-help@r-project.or
I tried for example:
Plot(mycluster, font=2)
But this changes only the font size of the y-axis.
Regards
Johannes
--
Project Coordinator BIOTA West Amphibians
Museum of Natural History
Dep. of Research (Herpetology)
Invalidenstrasse 43
D-10115 Berlin
Tel: +49 (0)30 2093 8708
Fax: +49 (0)30 2093
can you provide reproducible code please?
even a fake example would help.
I would
1) set up a loop to read in each file from a directory
2) inside the loop chop up/ aggregate the data, each file in turn and spit
each new aggreagated file out to a directory using write.table(). This will
redu
On May 13, 2009, at 9:12 AM, Martial Sankar wrote:
Dear All,
I would like to use the 'split' function on the dataframe elements
contained in a list L.
For example :
(df <- data.frame(cbind(c(rep('A',2), rep('B',2)), rep(1:4
X1 X2
1 A 1
2 A 2
3 B 3
4 B 4
(L<-split(df, df$X1
I'm afraid I have no experience with the clue package, but if all else fails
you could consider the hclust package.
You change font size in the conventional way with this.
Cheers, Simon.
- Original Message -
From: "Penner, Johannes"
To:
Sent: Wednesday, May 13, 2009 3:08 PM
Subjec
Hello!
I very minor point.
I typed help.search("classification").
It found a bunch of things including "randomForests" - which makes a lot sense.
I am wondering why "rpart" was not found. I think - it should make sense too.
--
Dimitri Liakhovitski
MarketTools, Inc.
dimitri.liakhovit...@markett
A new version of Design will be posted to CRAN in the next 2 days.
After than, update your system, including an update to the survival
package. Then re-try.
Your formula is wrong as it can't be negative. LR should be the
likelihood ratio chi-square stat : -2 times the difference in the two
Dear All,
I would like to use the 'split' function on the dataframe elements contained in
a list L.
For example :
> (df <- data.frame(cbind(c(rep('A',2), rep('B',2)), rep(1:4
X1 X2
1 A 1
2 A 2
3 B 3
4 B 4
> (L<-split(df, df$X1))
$A
X1 X2
1 A 1
2 A 2
$B
X1 X2
3 B 3
4
I would like to change to size of the names in a cluster dendrogram (not
the axis or the header) (package clue). The "normal" things (pch,
cex.label, font) do not work here.
Thanks in advance!
Johannes
__
R-help@r-project.org mailing list
https://stat.e
Dieter Menne wrote:
Dimitri Szerman-2 wrote:
Hello,
I was wondering if there is a function in R that imports tables directly
from a HTML document.
The XML package can do this:
http://markmail.org/message/cyicoa3htme4gei2
Duncan Temple Lang:
The htmlParse() and htmlTreeParse() functions in
I wonder - isn't this issue one of the reasons to use RandomForests
rather than CART?
On Wed, May 13, 2009 at 8:03 AM, Liaw, Andy wrote:
> From: Uwe Ligges
>>
>> Yuanyuan wrote:
>> > Greetings,
>> >
>> > I am using rpart for classification with "class" method.
>> The test data is
>> > the Indian
threshold wrote:
>
> Hi, do you have any suggestions how to make 3D scatterplot, BUT under
> linux. Worth mentioning is the fact that 'scatterplot3d' does not load
> under Ubuntu 8.10.
> Do you know any alternatives?? I tried cloud or persp but X,Y and Z axes
> are emprical in my case, and cann
What types of data are in each file? All numbers, or a mix of numbers
and characters? Any missing data or special NA values?
On Wed, May 13, 2009 at 7:45 AM, SYKES, Jennifer
wrote:
> Hello
>
>
>
> Apologies if this is a simple question, I have searched the help and
> have not managed to work out
I'd first try plyr and see if it's efficient enough,
library(plyr)
listOfFiles <- list.files(pattern= ".txt")
d <- ldply(listOfFiles, read.table)
str(d)
alternatively,
d <- do.call(rbind, lapply(listOfFiles, read.table))
HTH,
baptiste
On 13 May 2009, at 12:45, SYKES, Jennifer wrote:
1 - 100 of 151 matches
Mail list logo