Displaying 20 results from an estimated 3000 matches similar to: "Group close numbers in a vector"
2011 May 09
2
Creating Observation ID
If I have a data frame something like:
Value=rnorm(30)
Group = sample(c('A','B','C'), 30, replace=TRUE)
df = data.frame(Value, Group)
It seems like it should be simple to create an 'ObsID' column which indicates the observation order of each Value within each of the 3 groups. Somehow, I can't quite see how to do it without manually sub-setting the parent data
2011 May 19
2
recursive function
Hi,
I created a function for obtaining the normal cumulative distribution (I
know all this already exists in R, I just wanted to verify my
understanding of it). below is the code I came up with.
cdf<-function(x) {
erf<-function(x) {
# approximation to the error function (erf) of the
# normal cumulative distribution function
# from Winitzki
2011 May 20
5
regression coefficient for different factors
Dear R-helpers,
In my dataset I have two continuous variable (A and B) and one factor.
I'm investigating the regression between the two variables usign the command
lm(A ~ B, ...)
but now I want to know the regression coefficient (r2) of A vs. B for every factors.
I know that I can obtain this information with excel, but the factor have 68 levels...maybe [r] have a useful command.
Thanks,
2012 Mar 06
1
Windows - **Paste commands only** issue
In following a thread on this mailing list, I encounter an apparent issue
with **Edit | Paste commands only** in the Windows R-GUI.
Reproducible steps:
Go to (using IE?):
http://www.r-bloggers.com/select-operations-on-r-data-frames/
Find the section entitled 'Duplicate row names'
Copy the following lines from the web page
< a = matrix(1:18, nrow=6, ncol=3)
< rownames(a) <-
2018 Jul 16
2
persp command
Dear R-devel mailing list,
I am wondering whether the "theta" and "phi" parameters of the "persp"
function
in the graphics commands are named in error (the names seem to have been
swapped). Also, in the documentation to "persp", reference is made to
"colatitude"
when the effect in the image is actually that of "latitude".
Thank you,
2011 Mar 25
2
library(foreign) read.spss warning
I got the following:
> library(foreign)
> swal = read.spss("swallowing.sav", to.data.frame =TRUE)
Warning message:
In read.spss("swallowing.sav", to.data.frame = TRUE) :
swallowing.sav: Unrecognized record type 7, subtype 21 encountered in system file
>
The bulk of the data seems to read in a usable form, but I'm curious about what might be getting lost
2011 May 27
1
Normality test
Dear Sir,
I am writing to inquire about normality test given in nortest package. I
have a random data set consisting of 300 samples. I am curious about which
normality test in R would give me precise measurement, whether data sample
is following normal distribution. As p value in each test is different in
each test, if you could help me identifying a suitable test in R for this
medium size of
2011 Oct 11
1
How to run Rcmdr with OS 10.4?
I've installed Rcmdr package and it doesn't run
Here is the error message:
R version 2.9.2 (2009-08-24)
[R.app GUI 1.29 (5464) powerpc-apple-darwin8.11.1]
[Workspace restored from /Users/jfc/Documents/TravauxFR/.RData]
Le chargement a n?cessit? le package : tcltk
Chargement de Tcl/Tk... termin?
Le chargement a n?cessit? le package : car
Error in
2011 Oct 08
2
[R ]Plot a colored rectangle under the points of a graph
Hello everyone,
if I have:
x=1:10
y=1:10
plot(x,y)
and I plot a rectangle
rect(4,0,6,11, col=5)
it covers the points of the graph.
Is there a way to draw the rectangle under the points?
I was thinking the a solution could be draw an empty plot
then draw the rectangle and after the points,
but it did not work.
Any idea?
thanks for your help
H.
[[alternative HTML version deleted]]
2011 May 13
3
Excel to R
Hello R-help
I am trying to copy and paste large column of data from windows Excel into R
base speed sheet using:
Data1<-edit(data.frame())
But I can only copy and paste one cell at a time which is time consuming.
Also how can assign each column to a variable.
[[alternative HTML version deleted]]
2012 Mar 30
2
Problem loading package 'JGR' using R-2.15.0 (Win32).
Hi all.
Upon attempting to load the 'JGR' package, on a Win32 machine (SP3), a
pop-up message appeared stating that R had encountered a problem and needs
to close. Has anyone else encountered this?
Thanks.
~Caitlin
[[alternative HTML version deleted]]
2011 Feb 10
2
Hmisc errbar color
Is there an easy way to make the error bars the same color as the points and lines they are plotted with.
My example
# fake data
x=sample(1:10, 100, replace =T)
y = rnorm(100) + runif(100)
df=data.frame(x,y)
# summarize data
m = aggregate(df,list(x),mean)
se = aggregate(df,list(x),sd)/sqrt(10)
library(Hmisc)
plot(x,y)
errbar(m$x, m$y, m$y+1.96*se$y,
2012 May 18
3
How to create axis y axis for horizontal bar plot?
Hi,
i am working on bar plot but i need to generate y axis for horizontal bar
plot. In the attached diagram x-axis is there with scale 0 to 12 but i need
y axis. How can i implement it?
http://r.789695.n4.nabble.com/file/n4630478/barplot2.jpg
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/How-to-create-axis-y-axis-for-horizontal-bar-plot-tp4630478.html
Sent from the
2011 Jun 07
2
Line Graphs
Hello,
I want to plot 6 line graphs. I have 10 points 0.1, 0.2, 0.3, 0.4, 0.5, 0.6,
0.7, 0.8, 0.9 and 1.0.
At each point say 0.1, I have 6 variables A, B, C, D, E and F. The variables
all have values between 0 and 1 (and including 0 and 1). I also want to
label the x axis from 0.1 to 1.0 and the y axis from 0.1 to 1.0.
My goal is to plot a line graph representing the mean of the variables at
each
2012 May 15
2
how to find outliers from the list of values
Hi,
I am new to R and I would like to get your help in finding
'outliers'.
I have mvoutlier package installed in my system and added the package .
But I not able find a function from 'mvoutlier' package which will identify
'outliers'.
This is the sample list of data I have got which has one out-lier.
11489 11008 11873 80000000 9558 8645 8024 8371 It will
2012 Apr 03
2
Histogram from a table in R
Hi all,
I am new in R. I am trying to make an histogram but I can't figure it out.
I have .cvs table with a lot of data that look like this: I already have the
frequency of each interval (Counts).
Interval Counts
00:19 0
10:19 3117
20:29 4500
30:39 2330.......
I want to make the histogram with that. At the y axis I want to have the
Counts and at x axis I
2011 Dec 08
2
read.table question
Hello All,
This works,
results <- read.table("plink.txt",T)
while this doesn't.
results <- read.table("plink.txt")
Make sure your data frame contains columns CHR, BP, and P
What does adding the "T" in read.table do? Which argument does this
correspond to? I tried searching for it but didn't find the answer in:
read.table(file, header = FALSE,
2012 Feb 29
1
ggplot2 dot chart-start at zero
I am trying to create a simple dot-plot in ggplot2 with a solid line from the y-axis to the dot, something I first saw in Cleveland's 1984 book
What I would like is to have the graph start at zero on the x-axis but leave some space on the right side of the plot area.
I assumed that I should be able to do this with expand() in scale_x_continuous() but either I'm wrong or just don't
2012 Jan 04
5
a quick question about "rbinom"
Hello, I have the following code using rbinom, but I don't understand what
*"+1"* means in the code. Could someone help? Thanks so much,
> X1<-c("A","B")[rbinom(n,1,0.6)+1]
> X2<-c("C","D")[rbinom(n,1,0.1)+1]
--
View this message in context: http://r.789695.n4.nabble.com/a-quick-question-about-rbinom-tp4262977p4262977.html
Sent