Displaying 20 results from an estimated 400 matches similar to: "plotmath vector problem; full program enclosed"
2009 Aug 06
2
Convert dataframe to table with counts where column names become row names
Can anyone explain how best to go from a dataframe to a table (or better yet
a new dataframe) of counts, where the row names in the new table (or
dataframe) are the column names of the original df.
start w/
DF1 =
Pos1 Pos2 Pos3 ....
oligo1 G C A
oligo2 U U A
oligo3 G C C
oligo4 C G U
oligo5 A A G
.....
End with
DF2 =
2001 Nov 29
2
plotting (a) confidence intervals (b) standard error
Hi all,
I'm building a plot of the values in tmeant (below) against positions 1 to
5, using matplot.
tmeant looks like this:
case1 case2
pos1 861.8466 818.5909
pos2 961.2841 976.3466
pos3 878.6080 1262.8523
pos4 950.8011 1129.6080
pos5 968.1080 1063.3920
I also have lower (object tl) and upper (object tu) bounds on the
confidence intervals as follows:
tl:
pos1
2006 Apr 04
2
ogg + theora + seeking
Hi all,
I'm actually learning how to use ogg, theora and vorbis. My idea is to create
a small program running, that is able to concatenate ogg video+audio files.
However I have some small questions. Here I will start with the first one:
I read the following for seeking in ogg for a theora key-frame:
---- snipp (http://www.xiph.org/ogg/doc/ogg-multiplex.html) ----
[...]The third point
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings:
I would like comments on this example and after fixing it up, I need
help from someone who has access to insert this in R's help page for
plotmath.
I uploaded a drawing
http://pj.freefaculty.org/R/Normal-2009.pdf
that is created by the following code
http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R
This will be a good addition to the plotmath help page/example.
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9.
I've been experimenting with plotmath.
I wish it were easier to combine expressions in plotmath with values
from the R program itself. There are two parameters in the following
example, the mean "mymean" and standard deviation "mystd". I am able
to use bquote to write elements into the graph title like
mu = mymean
and R will
2008 Apr 08
2
plotmath "overstrikes" in output on a Linux system
I've been testing plotmath. But I'm getting some funny output one one
computer. The problem is that characters are 'jumbled' and overstrike
when symbols are introduced.
Sample code:
mu <- 440.0
sigma <- 12.5
myx <- seq( mu - 4*sigma, mu+ 4*sigma, length.out=500)
myDensity <- dnorm(myx,mean=mu,sd=sigma)
# Here's one way to retrieve the values of mu and sigma and
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all,
I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below.
> colnames(pos1)
[1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2010 Mar 09
3
Shade area under curve
I want to shade the area under the curve of the standard normal density.
Specifically color to the left of -2 and on. How might i go about doing
this?
Thanks
--
View this message in context: http://n4.nabble.com/Shade-area-under-curve-tp1586439p1586439.html
Sent from the R help mailing list archive at Nabble.com.
2009 Sep 23
1
Numerical integration problem
Hi there
I'm trying to construct a model of mortality risk in 2D space that
requires numerical integration of a hazard function, for which I'm using
the integrate function. I'm occasionally encountering parameter
combinations that cause integrate to terminate with error "Error in
integrate... the integral is probably divergent", which I'm not sure how
to interpret. The
2005 Jun 16
1
AIC in glm.fit with intercept
Dear R users,
glm.fit() gave me the same AIC's regardless of TRUE or FALSE intercept option.
> myX <- as.matrix(1:10)
> myY <- 3+5*myX
> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=TRUE)
> foo$aic
[1] 38.94657
> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=FALSE)
> foo$aic
[1]
2008 Dec 31
3
Plotmath with values?
I hope to use the plotmath facility to print titles that mix
math and values of R variables.
The help for "plotmath" has an example, which after repeated
reading, I find baffling. Likewise, I have read the help file
for "substitute" (wqhich seems to be needed) without ever
understanding what it does, other than being used in some magic
incantations.
I would like to do
2010 Jan 27
1
control of scat1d tick color in plot.Predict?
Hi All,
I have a quick question about using plot.Predict now that the rms package
uses lattice. I'd like to add tick marks along the regression line, which
is given by data=llist(variablename) in the plot call. The ticks show up
fine, but I'd like to alter the color. I know the ticks are produced by
scat1d, but after spending a fair bit of time going through documentation,
it still
2010 May 04
1
Avoiding for-loop for splitting vector into subvectors based on positions
Dear all,
I'm trying to optimize code and want to avoid for-loops as much as possible.
I'm applying a calculation on subvectors from a big one, and I get the
subvectors by using a vector of starting positions:
x <- 1:10
pos <- c(1,4,7)
n <- length(x)
I try to do something like this :
pos2 <- c(pos, n+1)
out <- c()
for(i in 1:n){
tmp <- x[pos2[i]:pos2[i+1]]
2011 Aug 18
1
Where are the ticks on grid.xaxis?
Hi R list,
I like the default ticks that are set up using grid.xaxis() or grid.yaxis()
with no arguments. Finding good values for the 'at' argument is usually not
a trivial task; the default behavior of these functions seems to work well.
The problem with this strategy is that I cannot figure out how to "recover"
the positions of these ticks when you do NOT specify the
2009 Feb 19
1
Getting the difference between two data frames
Dear R users,
I have the following data:
x <- data.frame( myX = c(1,2,3,4,5,6,7,8,9) )
y <- data.frame( myX = c(1,2,3,4,5,6,7) )
How can I get the difference between data frame x and y? In this case,
I want to get values 8 and 9
I know in SQL we can use minus operator, but I have no idea how to do so in R.
I tried all.equal, diff, and identical, but they don't give me the
actual data
2002 Mar 08
2
Sys.putenv environment variables disappear (PR#1371)
Environment variables set with Sys.putenv() disappear (i.e. become "")
after a while, especially after heavy-duty I/O. Example:
R> x <- matrix(1., 3000, 3000)
R> save(x, file="myx.RData")
R> Sys.putenv(HOME="/tmp")
R> while (Sys.getenv("HOME") != "") {cat("ok\n"); load("myx.RData")}
The loop prints
2006 Nov 24
1
Error in Calling C++ function from R!!!
Hello,
I tried to call an external function of R from the following code in C++:
void prodgdot(double *x, double *y, int *n, double *output)
{
int i;
*output=0;
for (i=0;i<*n;i++)
{
*output+=x[i]*y[i];
}
}
I compiled it using from my working directory in linux terminal and I think
it's ok:
giba at giba-desktop:~/mysrc/meus_testes_iniciais$ R CMD SHLIB
2008 Oct 29
1
How to set read.table variables to vectors?
The summary stats for the xin and yin variables below are correct. However,
if I use plot(xin,yin), an exception is thrown saying that "object xin is
not found."
Also, it is apparent that I can't successfully replace the x and y vectors
with values from xin and yin.
The four plots on one panel are showing but the range of x and y is only
[0,1], and therefore, it seems like an
2011 Jan 14
9
Selecting the first occurrence of a value after an occurrence of a different value
Hello everyone,
I am currently working with some data where I need to select the first
occurrence of a value after the occurrence of another value.
The data has two columns, one with a time and one with occurence of certain
events.
The column of data I want to select from looks like this (and each of these
events have a corresponding time in another column).
Stat71
OutMag
FirstResp
InMag
2009 May 25
3
Interpolating variables within (RODBC library) SQL statements for MySQL
Hi everyone,
I am desperately looking for a method to interpolate strings within an SQL
statement as follows:
I get a lot of rows out of a database (in my example POSITION_to_ZIPCODE
Database with holds records for German ZIP Code <--> Gauss-Krueger
Coordinate System ) and want this to be selected and computed individually
row by row as follows:
library(RODBC)
channel <-