Displaying 20 results from an estimated 10000 matches similar to: "Novice programing question"
2012 Feb 15
7
ggplot rank stack bar automatically.
Hi, all,
I am currently trying to learn this example.
http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/
I created the stack bar easily.
If I would like to rank the stack bar from the highest on the right,
shortest on the left and eventually
I could show the data "1991-00" on the left and "1823-30" on the right, how
could I do that?
Apart from this, I find
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:
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
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
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 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),
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,
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
2011 Feb 11
2
extracting p-values from the Manova function (car library)
hi,
i am not able to extract the p-values from the
Manova function in the car library. I need
to use this function in a high-throughput setting
and somehow need the p-values produced.
Any ideas?
Best regards
Bettina Kulle Andreassen
--
Bettina Kulle Andreassen
University of Oslo
Department of Biostatistics
and
Institute for Epi-Gen (Faculty Division Ahus)
tel:
+47 22851193
+47 67963923
2011 Aug 16
2
merge(join) problem
I have two datasets:
A with columns Open and Name (and many others, irrelevant to the merge)
B with columns Time and Name (and many others, irrelevant to the merge)
I want the dataset AB with all these columns
Open from A - a difftime (time of day)
Time from B - a difftime (time of day)
Name (same in A & B) - a factor, does NOT index rows, i.e., there are
_many_ rows in both A & B with
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
2011 Mar 09
2
R console Mac
Hi there,
I recently switched to Mac and I wonder if there is any way to get the R
console to autocomplete names of list objects or slots of objects. The
command line version allows to type e.g. list$ and two times the tab
button and then comes up with the names of the list objects. Same for slots of e.g. Eset objects
like eset. Unfortunately this does not work in the Mac R console.
Is there a
2009 Aug 25
2
how to pass user input to a function?
Hi everyone,
I'm building a website (http://yourpsyche.org) using Jeffrey Horner's
awesome Rapache module. I want to take user input, and pass it to an R
script. At first I was simply using if else statements, but after a
while I had so many nested if else's in my code that my head was
spinning. So then I started using cat() and source() to write
temporary files and read them back in
2007 Jun 18
1
the way to look at all the codings of any functions
Dear SIr,
In case of looking at the codes of the fuction, "cov",
we find all the codings below. But, incase of "mean", we don't find
the contents.
Please show me the way to look at all the codings of any functions.
Best regards,
Kei
-----------------------
> cov
function (x, y = NULL, use = "all.obs", method = c("pearson",
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
2010 Sep 04
3
Levels in returned data.frame after subset
Dear List,
When I subset a data.frame, the levels are not re-adjusted (see
example). Why is this? Am I missing out on some basic stuff here?
Thanks
Ulrik
> m <- data.frame(gender = c("M", "M","F"), ht = c(172, 186.5, 165), wt = c(91,99, 74))
> dim(m)
[1] 3 3
> levels(m$gender)
[1] "F" "M"
> s <- subset(m, m$gender ==
2008 Dec 12
7
character count
Dear list,
I have a variable that consists of typed responses. I wish to compute
a variable equal to the number of characters in the original variable.
For example:
> x <- c("convert this to 32 because it has 32 characters", "this one has 22 characters", "12 characters")
[Some magic function here]
> x
[1] 32 22 12
Any ideas?
2011 Aug 11
2
Extract values from a data frame
Hi everyone,
I have a data frame that looks *sort of* like this:
name <- letters[1:5]
signal.1 <- c("12", "bad signal", "noise", "10", "X")
length.signal.1 <- 5:9
intensity.signal.1 <- 3:7
signal.2 <- c("13", "noise", "19.2", "X", "V")
length.signal.2 <- 2:6
intensity.signal.2
2010 Oct 15
2
Time vs Concentration Graphs by ID
Hello-- I have a data for small population who took 1 drug at 3 different
doses. I have the actual drug concentrations as well as predicted
concentrations by my model. This is what I'm looking for:
- Time vs Concentration by ID (individual plots), with each subject
occupying 1 plot -- there is to be 9 plots per page (3x3)
- Observed drug concentration is made up of points, and predicted drug