Displaying 20 results from an estimated 10000 matches similar to: "Working with tables with missing levels"
2012 Mar 20
1
overriding "summary.default" or "summary.data.frame". How?
I suppose everybody who makes a package for the first time thinks "I
can change anything!" and then runs into this same question. Has
anybody written out information on how a package can override
functions in R base in the R 2.14 (mandatory NAMESPACE era)?
Suppose I want to alphabetize variables in a summary.data.frame, or
return the standard deviation with the mean in summary output.
2012 Dec 27
4
vectorization & modifying globals in functions
I have the following code:
--8<---------------cut here---------------start------------->8---
d <- rep(10,10)
for (i in 1:100) {
a <- sample.int(length(d), size = 2)
if (d[a[1]] >= 1) {
d[a[1]] <- d[a[1]] - 1
d[a[2]] <- d[a[2]] + 1
}
}
--8<---------------cut here---------------end--------------->8---
it does what I want, i.e., modified vector d 100 times.
2003 May 08
1
function to compute entropy
Maybe its slightly off-topic, but can anybody
help with computing entropy on matrix of probabilities?
Guess we have a matrix of probabilites, A, 2x2, something
like this:
z
x 0 1 2 3 4
0 0.063 0.018 0.019 0.016 0.000
1 0.011 0.162 0.040 0.042 0.003
2 0.015 0.030 0.164 0.033 0.002
3 0.012 0.035 0.036 0.159 0.002
4 0.004 0.021 0.018 0.013 0.082
sum(A)=1
Can i
2013 Nov 14
1
Re: make_random_password(): avoid modulo bias, and do not deplete system entropy (#9)
On Thu, Nov 14, 2013 at 01:48:17AM -0800, edwintorok wrote:
> Following the link to builder.ml from your blogpost I noticed the make_random_password () function, and I have some suggestions, well nitpicks really. See the 2 commits from this pull request.
>
> 1. Using Ocaml's buffered I/O means that one make_random_password() call reads 64k bytes from /dev/urandom which drops the
2008 Feb 26
4
"Raw" histogram plots
Hello
I need to plot a histogram, but insted of using bars, I'd like to plot
the data points. I've been doing it like this so far:
h <- hist(x, plot = F)
plot(y = x$counts / sum(x$counts),
x = x$breaks[2:length(x$breaks)],
type = "p", log = "xy")
Sometimes I want to have a look at the "raw" data (avoiding any kind of
binning). When x
2011 Jun 13
1
In rpart, how is "improve" calculated? (in the "class" case)
Hi all,
I apologies in advance if I am missing something very simple here, but since
I failed at resolving this myself, I'm sending this question to the list.
I would appreciate any help in understanding how the rpart function is
(exactly) computing the "improve" (which is given in fit$split), and how it
differs when using the split='information' vs split='gini'
2006 Nov 02
3
Better y-axis labels, and x-axis scaling
Hello
I'm plotting some data using matplot with a logarithmic scale on the
y-axis. This is the call to matplot I'm using:
matplot(turns, distances, type = "l", log = "y", lty = "solid",
ylab = "", xlab = "Time steps", col = c("black"))
The values for the 'distances' vector are always between 0 and 1.
The
2003 Dec 22
2
Memory allocation
Hello:
I am trying to work with a couple of microarray data sets, using
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 1
minor 8.1
year 2003
month 11
day 21
language R
In the shortcut for invoking R I have set
2008 Sep 15
2
Combining tables
Hello
Say I have the following data, and it's distribution given by table():
> x <- c(1, 1, 1, 2, 2, 3)
> tx <- table(x)
> tx
x
1 2 3
3 2 1
Now say I have new data,
> y <- c(3, 3, 3, 3, 4)
> ty <- table(y)
> ty
y
3 4
4 1
Is there a way to "combine" tx and ty in such a way to give me the
distribution below?
1 2 3 4
3 2 5
2005 Oct 31
3
question about precision, floor, and powers of two.
At the risk of being beaten about the face and body, can somebody explain
why the middle example: log2(2^3); floor(log2(2^3)) is different than
examples 1 and 3?
> log2(2^2); floor(log2(2^2))
[1] 2
[1] 2
> log2(2^3); floor(log2(2^3))
[1] 3
[1] 2
> log2(2^4); floor(log2(2^4))
[1] 4
[1] 4
>
DrC
[[alternative HTML version deleted]]
2011 May 12
1
log transformation and mean question
I have question about log2 transformation and performing mean on log2 data. I
am doing analysis for ELISA data. the OD values and the concentration
values for the standards were log2 transformed before performing the lm. the
OD values for samples were log2 transformed and coefficients of lm were
applied to get the log2 concentration values. I then backtransformed these
log2 concentrations and the
2005 Jan 24
1
mcnemar.test odds ratios, CI, etc.
Does anyone know of another version of the Mcnemar test that provides:
1. Odds Ratios
2. 95% Confidence intervals of the Odds Ratios
3. Sample probability
4. 95% Confidence intervals of the sample probability
Obviously the Odds Ratios and Sample probabilities are easy to calculate
from the contingency table, but I would appreciate any help on how to
calculate the confidence
2012 Apr 22
4
How to take ID of number > 7.
I figured out something new that I would like to see if I can do this more
easy with R then Excel.
I have these huge files with data.
For example:
DataFile.csv
ID Name log2
1 Fantasy 5.651
2 New 7.60518
3 Finding 8.9532
4 Looeka -0.248652
5 Vani 0.3548
With like header1: ID, header 2: Name, header 3: log2
Now I need to get the $ID out who have a &log2 value higher then 7.
I
2009 Mar 06
2
Interaction term not significant when using glm???
Dear all,
I have a dataset where the interaction is more than obvious, but I was asked
to give a p-value, so I ran a logistic regression using glm. Very funny, in
the outcome the interaction term is NOT significant, although that's
completely counterintuitive. There are 3 variables : spot (binary response),
constr (gene construct) and vernalized (growth conditions). Only for the FLC
construct
2012 Oct 15
2
warning message
Hi list,
Can somebody explain why there are these warning messages?? I just don't get it.? I'm using R 2.15.1 on WinXP.
Thanks!
Tao
> x
[1] -2.143510 -1.157450 -1.315581? 1.033562 -1.225440 -1.179909
>? ifelse(x>0, log2(x), -log2(-x))
[1] -1.099975 -0.210950 -0.395700? 0.047625 -0.293300 -0.238675
Warning messages:
1: In ifelse(x > 0, log2(x), -log2(-x)) : NaNs produced
2011 Jun 30
2
volcano plot.r
Hello.
My name is Akashah. i work at metabolic laboratory. From my study, i found that volcano plot can help a lot in my section.
i already studied about the volcano plot and get the coding to run in R software, unfortunately, there is may be something wrong with the coding. This is because no graph appear, but no error (blue color text) was shown on the R console. Below is the coding for
2008 Jul 08
1
calculation of entropy in R???
i want to calculate shannon entropy which is
H1,H2,H3....upto H7?
if there is any function or any package in
which i can find this entropy directly. do you have any information
please share this and i will be very thankful to you.
Regards,
++++++++++++++++++++++++++++++++++++++++++++++
MUHAMMAD FAISAL Department of Statistics and Decion Support system,
University of
2005 Jul 18
1
read large amount of data
Hi,
I have a dataset with 2194651x135, in which all the numbers are 0,1,2,
and is bar-delimited.
I used the following approach which can handle 100,000 lines:
t<-scan('fv', sep='|', nlines=100000)
t1<-matrix(t, nrow=135, ncol=100000)
t2<-t(t1)
t3<-as.data.frame(t2)
I changed my plan into using stratified sampling with replacement (col
2 is my class variable: 1 or 2).
2011 Jun 20
2
(no subject)
HELLO, anybody... could you help me to check the below coding for volcano.
what is the mistake?
what the plot could not display?
# volcano_plot.r
#
# Author: Amsha Nahid, Jairus Bowne, Gerard Murray
# Purpose: Produces a volcano plot
#
# Input: Data matrix as specified in Data-matrix-format.pdf
# Output: Plots log2(fold change) vs log10(t-test P-value)
#
#
2005 Aug 24
1
histogram method for S4 class.
Hi,
I'm trying to develop an histogram method for a class called "FLQuant"
which is used by the package FLCore (http://flr-project.org). FLQuant is
an extension to "array". There is an as.data.frame method that coerces
flquant into a data.frame suitable for lattice plotting. The problem is
that when I coerce the object and plot it after it works but if the
method is