Displaying 20 results from an estimated 10000 matches similar to: "How to 'de-cross' a table?"
2012 Apr 13
5
Merging two data frames with different columns names
I am trying to merge two data frames, but one of the column headings are
different in the two frames. How can I rjoin or rbind the tho frames?
Johnny
# Generate 2 blocks by confounding on abc
d1 <- conf.design(c(1,1,1), p=2, block.name="blk", treatment.names =
c("A","B","C"))
d2 <- conf.design(c(1,1,1), p=2, block.name="blk",
2017 Oct 20
1
create a loop
Hi R Users,
I do have very big data sets and wanted to run some of the analyses many
times with randomization (1000 times).
I have done the analysis using an example data but it need to be done with
randomized data (1000 times). I am doing manually for 10000 times but
taking so much time, I wonder whether it is possible to perform the
analysis with creating a loop for many replicated datasets?
2013 Jan 04
3
help "reshaping" dataframe
List,
I want to reshape my data, but I'm not sure how to do it... it might be a
simple task, but don't know which package does this.
"occ.data" (see below) is how my original data are arranged, and I know
that with melt() I can reshape it like "y" (see below). However, I just
want to build a matrix like the "y" matrix, but with only 2 dimensions.
Something
2007 Apr 26
2
path autocompletion in 2.5.0
Hi,
R 2.5.0 isn't auto-completing paths properly as it used to. E.g.
suppose I have:
> dir("CEL/choe")
[1] "chipC-rep1.CEL" "chipC-rep2.CEL" "chipC-rep3.CEL" "chipS-rep1.CEL"
[5] "chipS-rep2.CEL" "chipS-rep3.CEL"
Now if I do:
ReadAffy("CEL/choe/ch<tab> # => ReadAffy("CEL/choe/chip
2011 Aug 27
1
Overdispersed GLM
Hi all,
I have the following data:
rep1_treat rep2_treat rep1_control rep2_control
2 3 4 5
100 20 98 54
0 1 2 3
23 32 27
2005 Jun 10
2
Replacing for loop with tapply!?
Dear all,
We have a large data set with temperature data for weather stations
across the globe (15000 stations).
For each station, we need to calculate the number of days a certain
temperature is exceeded.
So far we used the following S code, where mat88 is a matrix containing
rows of 365 daily temperatures for each of 15000 weather stations:
m <- 37
n <- 2
outmat88 <- matrix(0,
2005 May 24
1
How to get special (Hershey) font symbols into plot axis labels? [Revisited]
Dear R users,
I would like to use sub- and super-script in axis labels. I assume this
is best done using Hershey symbols. When trying to find information on
using Hershey font symbols in axis labels, I came across the following
discussion thread:
http://maths.newcastle.edu.au/~rking/R/help/02a/1857.html
Have Hershey font implementations moved on since then?
Thanks,
Sander.
--
2005 Feb 16
5
Repeating grey scale in graph?
Dear R users,
Could somebody tell me why the grey color ramp is repeated in this
graph, eventhough the ramp values go from 0 to 1? I must be missing
something obvious, but I can not see it!
z <-
c(0.064329041,0.117243316,0.161565116,0.19923015,0.231642175,0.259835539,0.284571226,
0.038507288,0.094184749,0.140959431,0.180803984,0.215159105,0.245096084,0.271412845,
2005 Feb 18
3
Hosting a R Graph Gallery?
Dear R users,
Following some of the recent questions and discussions about the R
plotting abilities, it occurred to me again that it would be very
valuable to have an R graph gallery.
Eric Lecoutre made a very nice example in:
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/stats/fichiers/_gallery.pdf
It would be very useful to many beginners, but probably also advanced
users of R, to have an
2005 Aug 15
3
How to repeat code snippet for several variables in a data frame?
Dear all,
I have a data frame containing the results of an experiment. Like this:
a<-seq(1,4,by=1)
b<-seq(1,2,by=1)
test<-expand.grid(b,a,a)
colnames(test)<-c("replicates","bins", "groups")
test$abc <- rnorm(32)
test$def <- rnorm(32)
test$ghi <- rnorm(32)
test
The following code snippet aggregates the data for one variable and then
draws a
2004 May 17
1
Plotting Time against Date for time series data?
Dear all,
I have a data set containing GPS fixes of animal locations. To check that
the GPS's are working properly, I would like to plot the time of the fixes
(y-axis) against the date of the fixes (x-axis). If all works well, the
plot should show four regular fixes per day. The x-axis should be labelled
with month/year (i.e. 11/04) and the y-axis by hour from 00 to 24. I would
like to
2005 May 04
1
Plotting means and confidence intervals by group factor using lattice graphics?
Dear R graphics gurus,
Another question about lattice graphics. This time I would like to plot
means and confidence intervals by group factor in a lattice graph. I can
not find any working lattice examples. Maybe a custom panel function is
the answer, but that is a bit beyond me for now.
The individual plots within the lattice graph could look like this:
# Example with confidence intervals
2005 Apr 22
1
Help needed with lattice graph!
Dear R users,
If I manage to sort out this graph, it is certainly a candidate for the
new R graph gallery
(http://addictedtor.free.fr/graphiques/displayGallery.php)!
I created the following lattice graph:
library(lattice)
tmp <- expand.grid(geology = c("Sand","Clay","Silt","Rock"),
species =
2005 May 31
1
read.delim2 regarding "#"
Hello R experts:
When I tried to read my data into R, it does not take
# sign
A subset of Exp.txt is:
Experiment name assay id Varname
(A1)DBA TPA 6h/DBA Acetone rep1(A1) #3 4090 A90C1
(A2)DBA TPA 6h/DBA Acetone rep2(A2) #3 4091 A91C1
The command is:
Exp <- read.delim2("Exp.txt",check.names=F,as.is=T)
It is excuted but gave me all the NAs. Can you all
drop me a hint?
Thanks
2008 Mar 30
2
problem with white space
Hi,
I need to resample characters from a dataset that consists of an extremely
long string that is written over hundreds of thousands of lines, each of
length 50 characters. I am currently doing this by first inserting a space
after each character in the dataset and then using the following commands:
y <- as.matrix(read.table("data.txt"), stringsAsFactors=FALSE)
bstrap <-
2005 May 27
3
Soil texture triangle in R?
Dear R users,
has anybody made an attempt to create the soil texture triangle graph in
R? For an example see here:
http://www.teachingkate.org/images/soiltria.gif
I would like to get the lines in black and texture labels in gray to
allow for plotting my texture results on top.
Any examples or suggestions are very welcome!
Thanks in advance,
Sander.
--
2010 Dec 11
2
remove quotes from the paste output
Hi,
I'm generating the name of the variable with paste function and then using that
variable name further to get the specific position value from the data.frame,
here is the snippet from my code:
modelResults <- extractModelParameters("C:/PilotStudy/Mplus_Input/Test",
recursive=TRUE)
#extractModelParameters reads all the output files from the Test folder and
create the
2005 May 13
5
Conflict between xtable and Hmisc when using Sweave?
Dear R users,
The Sweave code below runs fine, as it is. However, an error occurs when
the line 'library(xtable)' is uncommented:
Error: chunk 1
Error in "label<-"(`*tmp*`, value = "month") :
no applicable method for "label<-"
Is anybody aware of this and knows a workaround?
Thanks,
Sander.
*******************
2005 Mar 17
0
Landscape indeces analysis methods as an R package!?
Dear Barry,
Thanks for your stimulating reply. As you see I have send a CC of this
reply to the R mailing list. The R mailing list will be the best place
to send your queries. You can subscribe here:
http://www.r-project.org/mail.html
I would think there is an interest in the provision of landscape
indices analysis methods in R. There are several packages for landscape
indices analysis
2012 May 10
2
Resampling question
Hello -
I have a population of 100 individuals that I would like to bootstrap
10 times, every time removing 5 *different* individuals.
So far, I have done the following:
pop <- read.table('mypop.txt', header=FALSE)
replicate(10, sample(pop, 95, replace=FALSE))
I have not actually gone through each of the 10 files created to make
sure no single individual was removed more than once