Why when I want to find my value from matrix I get: 2,3,4,1,2? I think that I
should get: 1,2,3,4,7,8.
macierz=matrix(1:4,7,8)
macierz[[2]]
[1] 2
macierz[[3]]
[1] 3
macierz[[4]]
[1] 4
macierz[[5]]
[1] 1
macierz[[6]]
[1] 2
This is a similar situation:
macierz=matrix(9,8,7,6)
Thank you for your help!
Yes you are right the probabilities are for the values 0 through 12.
I been asked to compare the simulated values to that of dbinom()
once again thanks!
Ranjan Maitra wrote:
This sounds like a potential homework problem. You don't quite need to
simulate anything
Sorry guys one quick question
I've graphed the histogram with
hist(rbinom(n = 1000, size = 10, prob = 0.25))
How to I sum the individual values 0 to 12?
regards
Brendan
beetle2 wrote:
Hi Guy's
I was wondering if someone could point me in the right direction.
dbinom(10,1,0.25)
I am
Hi Duncan,
Thanks, this solves my problem.
Regards, Hilmar
Duncan Murdoch schrieb:
On 18/04/2009 1:18 PM, Hilmar Berger wrote:
Hi all,
I have problems reading Unicode (UTF-16) coded tables in R 2.8.1
under Windows Vista.
Imagine the following table:
abcd
X1,21,31,4
I'm thinking I will just use:
results - rbinom(1000, 10, .25)
d = sum(results == 0 )
df = (d/1000)
df
And do each individually
beetle2 wrote:
Hi Guy's
I was wondering if someone could point me in the right direction.
dbinom(10,1,0.25)
I am using dbinom(10,1,0.25) to calculate the
I have a standard database - HouseVotes84
For example:
Class V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16
1 republicann y ny y y n n n y NA y y y ny
2 republicann y ny y y n n n nn y y y n NA
3 democrat NA y y NA
I've done some study.
And made a couple of loops to compare the dbinom() and rbinom()
Here are the results:
The instructor only asked for 1000 trials so its not that accurate. but its
close to it.
for(x in c(1:10))
+ {print(dbinom(x,10,.25)) }
[1] 0.1877117
[1] 0.2815676
[1] 0.2502823
[1]
Grześ wrote:
Why when I want to find my value from matrix I get: 2,3,4,1,2? I think that I
should get: 1,2,3,4,7,8.
macierz=matrix(1:4,7,8)
That's
matrix(data=1:4, nrow=7, ncol=8)
a 7x8 matrix with the numbers 1 to 4 repeated columnwise.
You probably want something like matrix(c(1:4, 7,
Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?
The quote I gave is from the documentation. How could it be more
explicit?
This is unfortunately typical of the
On 18/04/2009 8:47 PM, Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?
The quote I gave is from the documentation. How could it be more
explicit?
This is
Peter Dalgaard wrote:
Grześ wrote:
Why when I want to find my value from matrix I get: 2,3,4,1,2? I think
that I
should get: 1,2,3,4,7,8.
macierz=matrix(1:4,7,8)
That's
matrix(data=1:4, nrow=7, ncol=8)
a 7x8 matrix with the numbers 1 to 4 repeated columnwise.
You probably
Hi all,
I am using Sweave to produce a document. Unfortunately, I have to print
several copies and I can't print them in color. So I would like to
change the way of printing the code. I would like to print the code in a
box with a black borderline and a grey background (quite classic). Is it
On 19/04/2009 6:03 AM, Christophe Genolini wrote:
Hi all,
I am using Sweave to produce a document. Unfortunately, I have to print
several copies and I can't print them in color. So I would like to
change the way of printing the code. I would like to print the code in a
box with a black
Hi all,
I loaded the treectrl widget, but i can not add any elements oder styles.
Has anybody a little code snippet, please.
Thank you !
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Christophe Genolini wrote:
Hi all,
I am using Sweave to produce a document. Unfortunately, I have to
print several copies and I can't print them in color. So I would like
to change the way of printing the code. I would like to print the code
in a box with a black borderline and a grey
Grześ wrote:
I have a standard database - HouseVotes84
For example:
Class V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16
1 republicann y ny y y n n n y NA y y y ny
2 republicann y ny y y n n n nn y y y n NA
3
Hi everyone and thank you for the help you could give me.
My data is in a spreadsheet. The 1st column identifies the
firm (with the fiscal number), the columns 2 to 11 have
the variable value for 11 years. I have many variables
(files like this). Each file has about 40.000 firms
(rows). I
On Sat, 18 Apr 2009, Ron Burns wrote:
I want to set up a model with a formula and then run dynlm(formula) because I
ultimately want to loop over a set of formulas (see end of post)
R form - gas~price
R dynlm(form)
Time series regression with ts data:
Start = 1959(1), End = 1990(4)
snip
Dear R users,
I created some functions I want to convert in a package under Windows (Vista or
XP).
I carefully read both Writing R extensions by the R Development Core Team and
Creating R packages: a tutorial by Friedrich Leisch.
I've also installed Rtools as suggested.
These tutorials are
On 19/04/2009 9:02 AM, antonio.gasparr...@lshtm.ac.uk wrote:
Dear R users,
I created some functions I want to convert in a package under Windows (Vista or XP).
I carefully read both Writing R extensions by the R Development Core Team and
Creating R packages: a tutorial by Friedrich Leisch.
Cecilia Carmo schrieb:
The objective of my work is to do linear regressions with the
variables in the files or with other variables that I can obtain from
those by doing some mathematical operations. I’ve already tried to
import this information to an array in R, but I’ve seen that the
At 16:22 15/04/2009, Jonathan Williams wrote:
Dear R Helpers,
I have noticed that when I use lmer to analyse data, the summary function
gives different values for the AIC, BIC and log-likelihood compared with the
anova function.
I do not think I have seen a reply to this.
What happens if you
Dear all, excuse me for my simple questions: i had imported with read table a
database with x, y,value and i must do variogram with gstat.
can someone tell me how to do it? I read the help but I could not
to obtain variogram,
__
R-help@r-project.org
With due respect, and in all fairness, you should inform your instructor
that you took help from R's mailing list for doing homework.
This mailing list (or any other general mailing list for that matter) is
not for doing your (or anyone else's) homework. If the instructor
allowed that, that is a
Am I doing something wrong, here? If not, which are the real AIC and logLik
values for the different models?
I don't think it's reasonable to expect that the log-likelihood
computed by different functions be should comparable. Are the
constant terms included or dropped?
Hadley
--
Hi,
I need to represent data structures in a figure.stuff like trees with nodes
and pointers etc.can someone guide me to a package that does this?
--
Rajesh.J
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hi, can anyone help me with the following code? Thanks!
library(mvtnorm)
f2 - function(n, rho) {
var - matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T)
beta - seq(0, 1, length.out=n+1)
alpha - sort (sapply(1-beta, qnorm))
x - array(0, dim=c(n, n))
for (s in 1:n) {
for (t in 1:n){
if
Does anyone know a way to calculate the covariances between two
arrays/matrices x and y, row by row. i.e. var(x[n,],y[n,]) for all n ?
Benjamin Chain
Division of Infection and Immunity
Windeyer Building
UCL, 46 Cleveland St.
London W1T 4JF
Fax 00 44 20 7679 9301
sapply(seq_len(nrow(x)), function(i) var(x[i,], y[i,]))
Gabor
On Sun, Apr 19, 2009 at 7:12 PM, Benny Chain b.ch...@ucl.ac.uk wrote:
Does anyone know a way to calculate the covariances between two
arrays/matrices x and y, row by row. i.e. var(x[n,],y[n,]) for all n ?
Benjamin Chain
Division
Dear Benny,
Here is something that could get you a hint:
# Some data
set.seed(123)
X - matrix(rnorm(100),ncol=10)
Y - matrix(rnorm(100,2,4),ncol=10)
# Number of rows
n-nrow(X)
# Covariances
sapply(1:n,function(i) cov(X[i,],Y[i,]))
# [1] 0.23396819 0.51455839 1.13851842 -4.30551345
Depending upon the size of the matrix, using:
diag(cov(t(x), t(y)))
might be notably faster. On smaller matrices the time savings is
negligible.
Using Jorge's example below:
diag(cov(t(X), t(Y)))
[1] 0.23396819 0.51455839 1.13851842 -4.30551345 -2.60720372
[6] -0.06834326
hadley wrote:
Am I doing something wrong, here? If not, which are the real AIC and
logLik
values for the different models?
The difference here is that summary() is using REML=TRUE and anova()
is using REML=FALSE. It makes sense that anova (which is typically being
used to compare
Duncan Murdoch a écrit :
On 19/04/2009 6:03 AM, Christophe Genolini wrote:
Hi all,
I am using Sweave to produce a document. Unfortunately, I have to
print several copies and I can't print them in color. So I would like
to change the way of printing the code. I would like to print the
code
I have a string of binary values, and I would like to flip certain
bits in a set of positions.
Let's say the
vector p contains position [1, 3, 5, 7]
vector b contains bits [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
result r should be [0, 1, 0, 0, 0, 0, 0, 0, 1, 0]
in pseudo code this would be
I do not think your wetware processed the inputs correctly. The second
bit should not have been flipped:
Try this loop free index based solution:
b - c( 1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
r - b
r[p] - 0 + !r[p] # adding 0 converts logical TRUE/FALSE to 0/1
r
[1] 0 0 0 0 0 0 0 0 1 0
The if
try this:
b - c(1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
p - c(1, 3, 5, 7)
b[p] - ifelse(b[p] == 0, 1, 0)
b
[1] 0 0 0 0 0 0 0 0 1 0
On Sun, Apr 19, 2009 at 3:24 PM, Esmail esmail...@gmail.com wrote:
I have a string of binary values, and I would like to flip certain
bits in a set of positions.
beetle2 samandbren...@aapt.net.au [Sun, Apr 19, 2009 at 03:01:43AM CEST]:
I'm thinking I will just use:
results - rbinom(1000, 10, .25)
d = sum(results == 0 )
df = (d/1000)
df
And do each individually
ok, at least you are trying some things out for yourself. In fact, along
with reading
David Winsemius wrote:
I do not think your wetware processed the inputs correctly. The second
bit should not have been flipped:
Ooops .. yes you are right!
Try this loop free index based solution:
b - c( 1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
r - b
r[p] - 0 + !r[p] # adding 0 converts logical
jim holtman wrote:
try this:
b - c(1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
p - c(1, 3, 5, 7)
b[p] - ifelse(b[p] == 0, 1, 0)
I'll have to look up the ifelse operator, looks like
the ternary operator used in C
b[p] = b[p]==0?1:0
Cool - thanks!
Esmail
__
On 19/04/2009, at 9:45 PM, Duncan Murdoch wrote:
On 18/04/2009 8:47 PM, Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?
The quote I gave is from the
On 19/04/2009, at 8:59 PM, Patrick Burns wrote:
Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?
The quote I gave is from the documentation. How could it be
Rolf Turner wrote:
On 19/04/2009, at 8:59 PM, Patrick Burns wrote:
I think this unfairly blames R-core for being human.
Why is this unfair? R-core is supposed to be superhuman! :-)
Aiming for the fortune file again, eh?
--
O__ Peter Dalgaard Øster Farimagsgade
Rolf Turner r.tur...@auckland.ac.nz [Sun, Apr 19, 2009 at 10:01:34PM CEST]:
On 19/04/2009, at 9:45 PM, Duncan Murdoch wrote:
On 18/04/2009 8:47 PM, Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more
Hi,
i use Sweave to put plots in my .tex Documents. (pdflatex)
Is there a nice solution for this:
a) get a real LaTeX formula in the plot area.
I have only found very complicate solutions. Is there sth. like
\formula{x^2 = \oint f}
b) how can i format axis and legend to get exact the same
Perhaps try the pgfSweave package on r-forge?
http://r-forge.r-project.org/projects/pgfsweave/
HTH,
baptiste
On 19 Apr 2009, at 22:15, Jonas Stein wrote:
Hi,
i use Sweave to put plots in my .tex Documents. (pdflatex)
Is there a nice solution for this:
a) get a real LaTeX formula in the
On 19/04/2009 4:01 PM, Rolf Turner wrote:
On 19/04/2009, at 9:45 PM, Duncan Murdoch wrote:
On 18/04/2009 8:47 PM, Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Many thanks Duncan. Perhaps this merits a more explicit note in the
documentation?
Hi all,
I've searched high and low on this and found nothing of help. I'm using
v2.6.2 and trying to write a function that will count how many people from a
dataset fall under a poverty line of 50% of the mean income.
a9 is my 100-element vector of incomes. I want pa9 to be my vector that
counts
Hi All,
Thank you for all your help.
In future I will state if it's homework related.
regards
Brendan
beetle2 wrote:
Hi Guy's
I was wondering if someone could point me in the right direction.
dbinom(10,1,0.25)
I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges
Gavin Simpson wrote:
Grześ wrote:
I have a standard database - HouseVotes84
For example:
Class V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16
1 republicann y ny y y n n n y NA y y y ny
2 republicann y ny y y n n n nn
I have database write as .csv file.
When I want to get sth from my database I get NULL, but I know that there is
sth!
For example:
data$ID
NULL
data$kod
NULL
but command like below is always recognize by R
data[2,3]
[1] '082'
In my opinion this problem is also connect with my attempt to
After installing 2.9.0 I tried loading packages, but keep getting the following
error.
package 'robustbase' successfully unpacked and MD5 sums checked
Error in normalizePath(path) :
path[1]=C:\Program Files\R\R-2.9.0\library/robustbase: The system cannot
find the file specified
I've tried
If all you want is a count, then you can construct a logical vector
and count the TRUEs:
sum(a9 (mean(a9) / 2))
On Sun, Apr 19, 2009 at 5:58 PM, Enda Hargaden endaharga...@gmail.com wrote:
Hi all,
I've searched high and low on this and found nothing of help. I'm using
v2.6.2 and trying to
No, this is on Windows-Xp.
From: Erin Hodgess erinm.hodg...@gmail.com
To: Joseph P. Gray jpg...@uwm.edu
Sent: Sun, 19 Apr 2009 19:17:34 -0500 (CDT)
Subject: Re: [R] package installation error
Hi Pat!
Are you using Windows Vista by any chance, please?
If so, try running as administrator.
It
On Fri, Apr 17, 2009 at 3:36 AM, Jason Rupert jasonkrup...@yahoo.comwrote:
I apologize in advance that this question is not specific to R, but I
thought some R users may be using this in their work process flow.
I would like to be able to have a tool (prefer scriptable) that will take
two
I am attempting to create a plot with intervals stretched in the
x-direction using plotCI() in the plotrix package. The same data
provides an appropriate set of intervals when stretched in the
y-direction but I only get a lower interval when stretched in the
x-direction.
The data are as
On Apr 19, 2009, at 5:58 PM, Enda Hargaden wrote:
Hi all,
I've searched high and low on this and found nothing of help. I'm
using
v2.6.2 and trying to write a function that will count how many
people from a
dataset fall under a poverty line of 50% of the mean income.
a9 is my
On Apr 19, 2009, at 6:45 PM, Grześ wrote:
I have database write as .csv file.
The external sorage format is not likely to be relevant. What might be
informative would be to produce the code that reads this file.
When I want to get sth from my database I get NULL, but I know that
there
It is always unfair to complain about volunteer work, and what you
should do is to make contributions.
2009/4/20 Rolf Turner r.tur...@auckland.ac.nz:
On 19/04/2009, at 8:59 PM, Patrick Burns wrote:
Rolf Turner wrote:
On 17/04/2009, at 10:21 PM, Duncan Murdoch wrote:
Benjamin Tyner wrote:
Hi all,
I have relatively small dataset on which I would like to perform a PCA. I am
interested about a package that would also combine a method for determining
the number of components (I know there are plenty of approaches to this
problem). Any suggestions about a package/function?
thanks,
Bugzilla from n...@jonasstein.de wrote:
Hi,
i use Sweave to put plots in my .tex Documents. (pdflatex)
Is there a nice solution for this:
a) get a real LaTeX formula in the plot area.
I have only found very complicate solutions. Is there sth. like
\formula{x^2 = \oint f}
b) how
Dear Ben,
Le samedi 18 avril 2009 à 23:37 +, Ben Bolker a écrit :
Emmanuel Charpentier charpent at bacbuc.dyndns.org writes:
I forgot to add that yes, I've done my homework, and that it seems to me
that answers pointing to zero-inflated Poisson (and negative binomial)
are
Derek Ogle DOgle at northland.edu writes:
I am attempting to create a plot with intervals stretched in the
x-direction using plotCI() in the plotrix package. The same data
provides an appropriate set of intervals when stretched in the
y-direction but I only get a lower interval when
62 matches
Mail list logo