Displaying 20 results from an estimated 10000 matches similar to: "Return one value, print another"
2010 Jan 14
5
Better way than an ifelse statement?
Hello All,
I am trying to create a column of weights based off of factor levels
from another column. I am using the weights to calculate L scores.
Here is an example where the first column are scores, the second is my
"factor" and the third I want to be a column of weights. I can do
what I want with an ifelse statement (see below), but I am wondering
if anyone knows of a cleaner way
2010 Jun 02
8
bind select data frames
Dear group,
Here is my environment:
> ls()
[1] "DailyPL100419" "DailyPL100420" "DailyPL100421" "dd" "i"
"l" "PLglobal" "Pos100416" "Pos100419" "Pos100420"
"Pos100421" "position"
[13] "result" "sel"
2014 Aug 07
2
How to (appropropriately) use require in a package?
Dear All,
What is the preferred way for Package A, to initialize a cluster, and load
Package B on all nodes?
I am writing a package that parallelizes some functions through the use of
a cluster if useRs are on a Windows machine (using parLapply and family).
I also make use of another package in some of my code, so it is necessary
to load the required packages on each slave once the cluster is
2007 Jan 26
1
plotting results from tapply
Hi, there
I'm trying to plot what is returned from a call to tapply, and can't figure
out how to do it. My guess is that it has something to do with the
inclusion of row names when you ask for the values you're interested in,
but if anyone has any ideas on how to get it to work, that would be
stellar. Here's some example code:
y1<-rnorm(40, 2)
x1<-rep(1:2, each=20)
2003 Jul 22
4
greek in main title
Hello,
I have written a function that demonstrates the CLT by
generating samples following the exponential distribution,
calculating the means, plotting the histogram, and drawing
the limiting normal curve as an overlay. I have the title
of each histogram state the sample size and rate (1/theta)
for the exponential (the output is actually 4 histograms),
but I can't get the greek letter theta
2008 Oct 05
1
Sample mean in R
I am having issues with the following:
(muhat = 1/n^2(sum of all the xi's) )
essentially if xbar = the sample mean, muhat = sample mean but square the n.
Question:
Use R to run a Monte Carlo simulation which compares the finite-sample
performance of xbar and muhat. Specifically generate 1000 samples n=30 from
a standard normal distribution. For each sample calculate xbar and muhat. I
have
2007 Jul 25
3
Constructing bar charts with standard error bars
I am new to R.
I want to graph group data using a "Traditional Bar Chart with Standard
Error Bar", like the kind shown here:
http://samiam.colorado.edu/~mcclella/ftep/twoGroups/twoGroupGraphs.html
Is there a simple way to do this?
So far, I have only figured out how to plot the bars using barplot.
testdata <- scan(, list(group=0,xbar=0,se=0))
400 0.36038 0.02154
200 0.35927
2013 Feb 08
2
qcc package
Greets,
My data looks like:
> p3.18
s xbar subgroup
1 0.84 12.2 1
2 1.64 11.2 2
3 2.07 10.6 3
4 2.49 12.2 4
5 0.84 11.2 5
...
Using the command
> qcc(p3.18$xbar,type="xbar",sizes=5,center=mean(p3.18$xbar),std.dev=mean(p3.18$s)/0.94,title="X-bar Chart for Paper Sheet Length Data")
I get the x-bar chart I expect.
However,
2007 Dec 30
1
Histogram with different colors for different portions
Dear Rusers,
I would like to color different sections of a histogram different colors.
I have an example that was done by "brute force" given below. Has anyone
implemented something like this in general? If not, any suggestions/pointers
on how to write a general function to do so would be most appreciated.
Alan-
2011 Mar 03
3
Probabilities greather than 1 in HIST
Dear all,
I am a newbie in R and could not find help on this problem. I am trying to
plot an histogram with probabilities in the y axis. This is the code I am
using:
#TLC uniform
n=30
mi=1; mx=6
nrep=1000
xbar=rep(0,nrep)
for (i in 1:nrep) {xbar[i]=mean(runif(n,min=mi,max=mx))}
hist(xbar,prob=TRUE,breaks="Sturges",xlim=c(1,6),main=paste("n =",n),
xlab="Média",
2008 Sep 02
2
qcc help
Hi Gents,
I need to get the control limits from qcc function.
As follows:
qcc(MDI, type = "xbar.one")
Call:
qcc(data = MDI, type = "xbar.one")
xbar.one chart for MDI
Summary of group statistics:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.3266 0.4249 0.4371 0.4333 0.4451 0.4858
Group sample size: 1
Number of groups: 383
Center
2010 Jul 16
4
how to comment off sections
Hello,
Is there an way to easy comment of sections of code? I was thinking
something along the lines of
\dontrun{
codeline 1
....
codeline k
}
but that could be used in regular script files. When I am still
working on a script, I often want to being using what is done, but I
would like the parts I am still working on not to be run when I use
source() on the file. I can set everything off
2006 Nov 05
3
struggling to plot subgroups
Hi Folks,
I have data that looks like this:
freq gender xBar
1000 m 2.32
1000 f 3.22
2000 m 4.32
2000 f 4.53
3000 m 3.21
3000 f 3.44
4000 m 4.11
4000 f 3.99
I want to plot two lines (with symbols) for the two groups "m" and
"f". I have tried the following:
plot(xBar[gender=="m"]~freq[gender=="f"]) followed by
2010 Sep 17
1
how to work with Year-Month dates
Hi all,
Is there a built in or easier way to work with dates that are *just* Year-Month?
Right now I paste() on a day as a work around, but it ultimately needs to be
in Year-Month form, so then I use format() to get rid of the day.
x <- c("2006-December", "2006-July")
x <- paste(x, "-01", sep='')
x <- as.Date(x, "%Y-%B-%d")
x <- sort(x)
2011 Sep 24
3
Supporting R/Membership
Dear R Users,
I know issues like this have come up in the past. I am wondering how
many people would be interested in an online mechanism for donating to
the R Foundation or for becoming supporting members. Right now, the
link for it is somewhat buried on the R home page, and once you get
there, the options are to mail or fax a form. IIRC, Paypal was not a
good option due to some fees, but
2001 Jun 21
2
timeseries: R/S (rescaled range) analysis
Has anyone written utilities to do rescaled range analysis in R?
Jeff
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2017 Jul 08
2
CRAN I-MR / Xbar-R / Xbar-S control chart package ?
Hi,
I've had a quick look through the package list, and unless I've missed
something, I can't seem to find anything that will do I-MR / Xbar-R /
Xbar-S control charts ?
Assuming there is something out there, can anyone point me in the
right direction ?
Thanks !
TIm
2007 Apr 28
1
pacf
Hi,
I wanted to understand exactly how acf and pacf works, so I tried to
calculate ac and pac manually. For ac, I used the standard acf formula:
acf(k) = sum(X(t)-Xbar)(X(t-k)-Xbar))/sum(X(t)-Xbar)^2. But for pac, I could
not figure out how to calculate it by hand. I understand that in both R and
EVIEWS, it is done using the Durbin-Levinson algorithm by the computer.
However, I don't
2010 May 05
4
P values
How do u calculated p values for a z test..
so far i ve done this
A = read.table("cw3_data.txt")
xbar = mean(A)
s = 1
n = 20
mu = 0
z.test = (xbar-mu)/(s/sqrt(n))
p.value = pnorm(abs(z.test))
error = qnorm(0.99)*s/sqrt(n)
left = xbar - error
right = xbar + error
and have got values off of it...but the values for p dont match up with
other sites that i have used to check it
2002 May 11
2
Bug on Mac version of lm()?
Dear Mac users,
Hi, as you might have probably read the thread of
"[R] Rsquared in summary(lm)" on May 10, it seems that Mac version of
lm() seem to be working incorrectly.
I enclose the script to produce the result both for lm() and manual
calculation for a simple regression. Could you run the script and
report with the version of R, so I don't have to go through every
builds