Displaying 20 results from an estimated 30000 matches similar to: "combining two columns into one column despite NAs"
2011 Mar 25
4
two plots in qplot
Hello
I simply want to plot two variables against one 'year' variable in
qplot.
Is any way of doing this without reshaping data in long format and using
facet function afterwards?
Thank you
Denis
2011 Aug 22
3
automatic file input
Dear all,
I have 100 files which are used as input.and I have to input the name of my files again and again.the name of the files are 1.out, 2.out......100.out.
I want to know if there is anything like perl so that i can use something like this-
for($f = 1; $f <= 100; $f++) {
$file = $f.".out";
I have tried this thing in R but it does not work.Can somebody please help me.
2011 Feb 11
6
linear models with factors
i am trying to fit a linear model with both continuous covariates and
factors. When fitted with the intercept
term the first level of the factor is treated by R as intercept and the
estimate of the effects of remaining levels(say i th level) are given as
true estimate of i th level - estimate of 1st level.can any please help me?
thanks in advance.....
--
View this message in context:
2018 Feb 20
3
Take the maximum of every 12 columns
This is what I was looking for. Thank you everyone!
Sincerely,
Milu
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Mail
priva di virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
2011 Jul 25
4
ggplot question: changing the label for the Y axis on a histogram
Some help with how to re-label the vertical axis in a histogram would be appreciated.
qplot(off.sc,weight=rel.freq,binwidth=.29,main="test Figure"+ylab("New from inside"))+ylab("New from outside")+
xlab("off.sc\nAggregated frequency plots for 17 equal intervals.")
The code
2011 Mar 11
4
Any existing functions for reading and extracting data from path names?
Hi helpeRs,
I have inherited a set of data files that use the file system as a
sort of poor man's database, i.e., the data files are nested in
directories that indicate which city they come from. For example:
dir.create("deleteme")
for(i in paste("deleteme", c("New York", "Los Angeles"), sep="/")) {
dir.create(i)
for(j in
2018 Feb 20
2
Take the maximum of every 12 columns
On Tue, Feb 20, 2018 at 11:58 AM, Bert Gunter <bgunter.4567 at gmail.com>
wrote:
> Ista, et. al: efficiency?
> (Note: I needed to correct my previous post: do.call() is required for
> pmax() over the data frame)
>
> > x <- data.frame(matrix(runif(12e6), ncol=12))
>
> > system.time(r1 <- do.call(pmax,x))
> user system elapsed
> 0.049 0.000
2009 Nov 20
2
Finding & replacing non-ASCII characters
Hi guys,
Are there any feasible methods in searching & finding non-ASCII characters
in R?
For example, from the following object,
x <- mia. SzaÌmitaÌó
The desired output is,
x.out <- mia. SzaImitaIA
Your help in resolving this would be greatly appreciated.
[[alternative HTML version deleted]]
2011 Feb 21
2
Equivalent of log file in R?
Hi everyone,
Is there a way to make R save the workspace output (just the results,
not the objects themselves) as you go? I'm running analysis that takes
a long time to run and I want to be able to interrupt it without
losing all the output to date. Is there an alternative to putting
"save.image()" commands after every couple lines of code?
Best,
Tatyana
2018 Feb 20
0
Take the maximum of every 12 columns
Ista, et. al: efficiency?
(Note: I needed to correct my previous post: do.call() is required for
pmax() over the data frame)
> x <- data.frame(matrix(runif(12e6), ncol=12))
> system.time(r1 <- do.call(pmax,x))
user system elapsed
0.049 0.000 0.049
> identical(r1,r2)
[1] FALSE
> system.time(r2 <- apply(x,1,max))
user system elapsed
2.162 0.045 2.207
##
2011 Aug 23
2
Replacing NAs in one variable with values of another variable
Hello everyone,
I am trying to figure out a way of replacing missing observations in one of
the variables of a data frame by values of another variable. For example,
assume my data is X
X <-as.data.frame(matrix(c(9, 6, 1, 3, 9, "NA", "NA","NA","NA","NA",
6, 4, 3,"NA", "NA", "NA", 5, 4, 1, 3),
2010 Jan 25
1
reshape package cast() function
Hi all,
I think I'm cracking up. Please help me understand why I'm getting
different results with m.test and m.test2 in the example below.
> library(reshape)
Loading required package: plyr
>
> m.test <- data.frame(id = factor(rep(1:10, 2)), variable=rep(c("var1","var2"),10), value=rnorm(20))
> cast(m.test, ...~variable, value="value") ## cast
2011 Jul 26
2
Accessing the index of factor in by() function
Hello,
Here are three vectors to give context to my question below:
*id <- c(1,1,1,1,1,2,2,2,3,3,3))
month <- c(1, 1, 2, 3, 6, 2, 3, 6, 1, 3, 5)
value <- c(10, 12, 11, 14, 16, 12, 10, 8, 14, 11, 15)*
and I want to plot "value" over "month" separately for each "id". Before I
can do that, I need to section both month and value, based on ID. I create a
2009 Oct 25
1
A naive question about permutation tests in the coin package
Dear R helpers,
I am trying to understand how to use the independence_test function in
the coin package. I think I suffer from a misunderstanding about what
the package does. Either that or I do not understand how to use it
properly. Specifically, I cannot understand if I can test independence
of arbitrary statistics.
Take the following example:
set.seed(10)
d <- data.frame(y = c(rnorm(10,
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a
procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE
regression commands in SPSS?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
2011 Jun 06
1
Merge two columns of a data frame
I have the following data:
prefix <- c("cheap", "budget")
roots <- c("car insurance", "auto insurance")
suffix <- c("quote", "quotes")
prefix2 <- c("cheap", "budget")
roots2 <- c("car insurance", "auto insurance")
roots3 <- c("car insurance", "auto
2011 Mar 08
3
A plot similar to violin plot
Dear R Users,
I would like to know is there any package to create a plot like this?
http://dl.dropbox.com/u/5409929/cs1160521f01.gif
X axis is categorical. And the positions of the points are
corresponding to the frequency. (similar to violinplot)
Thank you.
Regards,
CH
--
CH Chan
2018 Feb 20
0
Take the maximum of every 12 columns
It looks like OP uses a data.frame, so in order to use matrixStats
(I'm the author) one would have to pay the price to coerce to a matrix
before using matrixStats::rowMaxs(). However, if it is that the
original data could equally well live in a matrix, then matrixStats
should be computational efficient for this task. (I've seen cases
where an original matrix was turned into a data.frame
2011 Sep 08
2
ggplot geom_freqpoly() layers ..?
Hi,
I was trying to overlay/combine two freqpoly plots. The sample code below
illustrates the problem. Essentially, I want to do is:
1. Have the same colour for all the lines in 'Plot 1' (and 'Plot 2').
Currently, all the lines in Plot 1 have different colours and all the lines
in Plot 2 have different colors. I'd like for all lines in Plot 1 to be
'red' and all the
2011 Feb 04
4
aggregate function - na.action
Can someone please tell me what is up with na.action in aggregate?
My (somewhat) reproducible example:
(I say somewhat because some lines wouldn't run in a separate session, more
below)
set.seed(100)
dat=data.frame(
x1=sample(c(NA,'m','f'), 100, replace=TRUE),
x2=sample(c(NA, 1:10), 100, replace=TRUE),
x3=sample(c(NA,letters[1:5]), 100, replace=TRUE),