Dear all,
I am a new user to R and I am using pracma and nloptr libraries to minimize
a numerical integration subject to a single constraint . The integrand
itself is somehow a complicated function of x and y that is computed
through several steps. i formulated the integrand in a separate
To the volunteers of R-Help.
Hello, I am currently stuck on an RStudio assignment. The assignment
involves creating a double bar graph with the provided info
http://math.fullerton.edu/mori/data/introstats/pennstate3.txt
My professor has only gone over the very basics of RStudio and we only
Dear Eliza,
Thank you for testing the code. Sorry, it was a mistake.
I created one more file Eliza3.txt (attached)
Try this.
library(stringr)
lapply(list.files(),function(i) str_count(gsub( $,,readLines(i)), ))
#[[1]]
# [1] 7 7 7 7 6 7 7 7 7 7 6 6 7 7 7 7 6 7 7 7 7 7 6 6
#[[2]]
# [1] 7 7 7 7
On 02/16/2013 05:30 PM, Andrew Roberts wrote:
Folks,
I am having problems with a plot I want to create to give an impression
of changes in an ordinal scale measure (1-5) at three time points (0, 14
and 21 days). I can produce a radial plot of bare vectors but getting
this to appear on the base
Le vendredi 15 février 2013 à 20:52 -0600, Erin Hodgess a écrit :
Dear R People:
I'm using R2HTML but having a strange result.
Here is the original data:
resp trt block
90.3 A I
89.2 A II
98.2 A III
93.9 A IV
87.4 A V
97.9 A VI
92.5 B I
89.5 B II
90.6 B III
94.7 B IV
87.0 B V
On Feb 15, 2013, at 11:31 PM, Brian Ngo wrote:
To the volunteers of R-Help.
Hello, I am currently stuck on an RStudio assignment. The assignment
involves creating a double bar graph with the provided info
http://math.fullerton.edu/mori/data/introstats/pennstate3.txt
My professor has only
You could use the likert plot in the HH package. Look particulsrly at the
population pyramid example.
Sent from my iPhone
On Feb 16, 2013, at 2:31, Brian Ngo brianng...@csu.fullerton.edu wrote:
To the volunteers of R-Help.
Hello, I am currently stuck on an RStudio assignment. The
On Sat, Feb 16, 2013 at 10:21 AM, Rmh r...@temple.edu wrote:
You could use the likert plot in the HH package. Look particulsrly at the
population pyramid example.
Or better yet, ask your professor!
Sent from my iPhone
On Feb 16, 2013, at 2:31, Brian Ngo brianng...@csu.fullerton.edu
No solution since it is a school work exercise but some hints:
First read the barplot help. Enter ?barplot to bring it up. I find it best to
Then have a look at ?par specifically the mfcol, mfrow entry.
Also just google for something like R statistics barplot color / colour and
so on
Hello again,
I have a question on who sum() handle the NA values.
sum(c(NA, 1), na.rm = TRUE)
[1] 1
I understand this. However could not agree with following:
sum(c(NA, NA), na.rm = TRUE)
[1] 0
Where this '0' is coming from? Should not it be NA itself?
Thanks and regards,
On Feb 16, 2013, at 11:55 AM, Christofer Bogaso bogaso.christo...@gmail.com
wrote:
Hello again,
I have a question on who sum() handle the NA values.
sum(c(NA, 1), na.rm = TRUE)
[1] 1
I understand this. However could not agree with following:
sum(c(NA, NA), na.rm = TRUE)
[1] 0
On 16-02-2013, at 18:55, Christofer Bogaso bogaso.christo...@gmail.com wrote:
Hello again,
I have a question on who sum() handle the NA values.
sum(c(NA, 1), na.rm = TRUE)
[1] 1
I understand this. However could not agree with following:
sum(c(NA, NA), na.rm = TRUE)
[1] 0
Thanks Marc for your reply.
However this leads to my problem of handling rowSums() function (hence
colSums()). Let take following matrix:
Mat - matrix(c(1, 1, NA, -1, 1, NA, NA, 1, NA), nc = 3)
Mat
[,1] [,2] [,3]
[1,]1 -1 NA
[2,]111
[3,] NA NA NA
rowSums(Mat,
By MIMIC do you mean multiple indicator/multiple cause? Something like
this: http://www.jeremymiles.co.uk/misc/fun/img059.gif
If so, you can use sem, Lavaan, or openMx.
Jeremy
On 13 February 2013 05:11, Hervé Guyon herve.gu...@yahoo.fr wrote:
I want estimate MIMIC latent variable with R
I am replying so that this will be accepted by the list.
D.
--
View this message in context:
http://r.789695.n4.nabble.com/Misundertanding-of-Levels-tp4658320p4658781.html
Sent from the R help mailing list archive at Nabble.com.
__
Nothing comes to mind immediately for rowSums() or colSums() given the way in
which they handle things, however using apply() you have more flexibility,
albeit at the price of some speed:
apply(Mat, 1, function(x) if (all(is.na(x))) NA else sum(x, na.rm = TRUE))
[1] 0 3 NA
Essentially, if
Hello,
I've got a data frame with a mix of numeric, integer and factor columns.
I'd like to pull out (or just operate only on) the numeric/integer columns.
Every thing I've found in searches is about how to subset by rows,
or how to operate assuming you have the column names. I'd like to pull
by
On 15.02.2013 16:37, Giovanni Petris wrote:
How about
c(a, b)
But then, if he is actually going to have a row vector, t() is needed -
and one may want to answer the OP who may not read this list
Best,
Uwe Ligges
?
HTH,
Giovanni
From:
On Feb 16, 2013, at 12:15 PM, Barry DeCicco bdecicco2...@yahoo.com wrote:
Hello,
I've got a data frame with a mix of numeric, integer and factor columns.
I'd like to pull out (or just operate only on) the numeric/integer columns.
Every thing I've found in searches is about how to subset by
Barry =
Suppose your data frame is called mydat. Then something like
mydat[,sapply(mydat,class) %in% c('numeric','integer')]
might do what you want.
- Phil
On Sat, 16 Feb 2013, Barry DeCicco wrote:
Hello,
I've got a data frame
http://stackoverflow.com/questions/5863097/selecting-only-numeric-columns-from-a-data-frame
John Kane
Kingston ON Canada
-Original Message-
From: bdecicco2...@yahoo.com
Sent: Sat, 16 Feb 2013 10:15:35 -0800 (PST)
To: r-help@r-project.org
Subject: [R] Extracting Numeric Columns from
Hello,
Though I think you should compute that integral symbolically by hand and
then define a function with the result, maybe package pracma can do what
you want.
[functions dblquad(9 and quad2d()]
Hope this helps,
Rui Barradas
Em 16-02-2013 17:01, julia cafnik escreveu:
Dear R-users,
On Feb 16, 2013, at 10:25 AM, David Arnold wrote:
I am replying so that this will be accepted by the list.
I don't think you achieved your goal. Some posting from Nabble are never
accepted. A couple of months ago the spam filters were tightened (in response
to a robotic mediated mass forgery
Hello,
You should provide us with a data example, like the posting guide says.
Anyway, see the following example.
# make up some data
dat - data.frame(X = 1:4, Y = rnorm(4), Z = letters[1:4])
str(dat)
# this returns the numeric/integer columns
dat[sapply(dat, is.numeric)]
Hope this helps,
On Feb 16, 2013, at 9:01 AM, julia cafnik wrote:
Dear R-users,
I'm wondering how to calculate this double integral in R:
int_a^b int_c^y g(x, y) dx dy
where g(x,y) = exp(- alpha (y - x)) * b
Thanks for answering!
One way would be to install the cubature package.
--
David
Thanks to all who responded!
I've taken those responses, and found out what works:
myNumericColumns-mydataframe[sapply(mydataframe, is.numeric)]
produces a subset of columns with just the numeric vectors.
Sincerely,
Barry
[[alternative HTML version deleted]]
Hi,
set.seed(15)
dat1-data.frame(col1=rnorm(6),col2=rep(1:2,each=3),col3=rep(letters[1:3],2),col4=runif(6),col5=rep(LETTERS[3:5],2))
dat1[,sapply(dat1,class)!=factor]
# col1 col2 col4
#1 0.2588229 1 0.5090904
#2 1.8311207 1 0.7066286
#3 -0.3396186 1 0.8623137
#4 0.8971982
Hi,
Try this:
ifelse(rowSums(is.na(Mat))==ncol(Mat),NA,rowSums(Mat,na.rm=TRUE))
#[1] 0 3 NA
A.K.
- Original Message -
From: Christofer Bogaso bogaso.christo...@gmail.com
To: Marc Schwartz marc_schwa...@me.com
Cc: r-help r-help@r-project.org
Sent: Saturday, February 16, 2013 1:22 PM
Hi,
Try by putting quotes ie.
res- do.call(c,...)
A.K.
From: Vera Costa veracosta...@gmail.com
To: arun smartpink...@yahoo.com
Sent: Saturday, February 16, 2013 7:10 PM
Subject: Re: reading data
Thank you.
In mine, I have an error 'what' must be a
Given a function that calls itself, what's the best way to detect the
entry point? The best I came up with is:
IsEntryPoint - function(){
par - sys.call(-1L)[[1]]
grandpar - sys.call(-2L)[[1]]
!identical(par, grandpar)
}
but this won't work for functions that don't directly
I needed to clean someone else code and run it through tidy.source. It
encountered a number of hangups which after some experimentation lead me to
suspect that the culprit is # symbol when it is a part of literal string. For
example if i copy the following to the clipboard
confuse.tidy -
Please scroll down to Section 7: https://github.com/yihui/formatR/wiki
And this has been reported at
https://github.com/yihui/formatR/issues/26 I'll try to fix it after R
3.0 is released.
Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of
Hi Gustav,
Try this:
lapply(1:length(models),function(i) lapply(models[[i]],function(x)
summary(x)$coef[2,]))[[1]] #1st list component
[[1]]
# Estimate Std. Error z value Pr(|z|) # pm10
#5.999185e-04 1.486195e-04 4.036606e+00 5.423004e-05
#[[2]]
# Estimate Std. Error z
HI Gustav,
If you need the combined output:
res-lapply(1:length(models),function(i)
do.call(rbind,lapply(models[[i]],function(x)
summary(x)$coef[row.names(summary(x)$coef)%in%c(pm10,ozone,so2),c(1:2,4)])))
names(res)-1:length(res)
res1-do.call(rbind,lapply(res,function(i)
Se não pode visualizar este e-mail corretamente, clique aqui
http://www.almasoma.pt/newsletter--terapia-para-bebes-aprenda-a-ajuda-los
.
http://www.almasoma.pt/
Formação em Terapia para Bebés
Lisboa, Outono 2013 - Primavera 2016
Workshop: Baby Clinic, 6 e 7 de Abril de 2013
On 02/17/2013 12:55 PM, Benjamin Tyner wrote:
Given a function that calls itself, what's the best way to detect the
entry point? The best I came up with is:
IsEntryPoint - function(){
par - sys.call(-1L)[[1]]
grandpar - sys.call(-2L)[[1]]
!identical(par, grandpar)
}
but this won't work for
do.call(rbind,lapply(2:3,function(m1) do.call(rbind,lapply(2:2,function(n1)
do.call(rbind,lapply(0:(m1-1),function(x1)
do.call(rbind,lapply(0:(n1-1),function(y1) expand.grid(m1,n1,x1,y1)
# Var1 Var2 Var3 Var4
#1 2 2 0 0
#2 2 2 0 1
#3 2 2 1 0
#4
d2- data.frame()
for (m1 in 2:3) {
for (n1 in 2:2) {
for (x1 in 0:(m1-1)) {
for (y1 in 0:(n1-1)) {
for (m in (m1+2): (7-n1)){
for (n in (n1+2):(9-m)){
for (x in x1:(x1+m-m1)){
d2- rbind(d2,c(m1,n1,x1,y1,m,n,x))
}}}
38 matches
Mail list logo