Hi R users:
I have a big data and want to calculate the running mean of this data .
How can I get this kind of result ? I have check the command mean
it seems mean could not get the running mean?
--
TANG Jie
[[alternative HTML version deleted]]
i wish to change a column of factor variable to multiple columns of
zero-ones
for example, my factor could be
ff=c('a','a','b','b','c','c')
then I want to have two columns (for three levels) that are
0 0
0 0
1 0
1 0
0 1
0 1
how can i do this fast?
[[alternative HTML version deleted]]
Hi,
I just wanted to share with you that we made a website over the weekend that
allows instant search of the R documentation on CRAN, see:
www.Rdocumentation.org. It's a first version, so any
feedback/comments/criticism most welcome.
Best regards,
Jonathan
On 12-06-2013, at 04:53, Abdul Rahman bin Kassim (Dr.) rahm...@frim.gov.my
wrote:
Dear R-User,
Appreciate any helps. It looks simple, but I don't have a clue.
Given that I have a dataframe of tree population with three variables:
sp=species ,
d0=initial_size
grow=growth increment
Hello,
Simply assign the output of a function to a variable:
xyzuvw - importdata(...)
and then use that output. In this case, a data.frame with, among others,
vectors 'x' and 'y'.
You need to read an R introductory text. I recommend An Introduction to
R, file R-intro.pdf in your doc
On 06/12/2013 05:47 PM, Gallon Li wrote:
i wish to change a column of factor variable to multiple columns of
zero-ones
for example, my factor could be
ff=c('a','a','b','b','c','c')
then I want to have two columns (for three levels) that are
0 0
0 0
1 0
1 0
0 1
0 1
how can i do this fast?
I have to use a loop (while or for) to return the result of hadamard
product. now it returns a matrix, but when I use is.matrix() to check, it
returns FALSE, whats wrong?
Matrix.mul - function(A, B)
{
while(is.matrix(A) == FALSE | is.matrix(B) == FALSE )
{print(error)
Dear colleagues,
This is to inform you that Version 1.3.2 of the R package *apcluster*
has been released on CRAN yesterday (note that it may still take a few
more hours until the Windows binary will be available). We added a
plotting function that also allows for plotting clustering results
The comments on StackOverflow are fair, I believe...
Please dput() your matrices, so that your code becomes reproducible!
On Wednesday 12 June 2013 11:14:35 maggy yan wrote:
I have to use a loop (while or for) to return the result of hadamard
product. now it returns a matrix, but when I use
Hi Max,
I think I get the cause of this error. I left unintentionally some NA's in
the y parameter of train().
Here is the example to reproduce it:
X - matrix(seq(1:100, 10, 10)
Y - seq(1:10)
Y[1] - NA
fit - train(X, Y, method=glmnet, preProcess=c(center,scale))
Regards,
Ferran
2013/6/11
Hello,
You can use, for instance, function ma() in package forecast.
# if not yet installed
#install.packages('forecast', dependencies = TRUE)
library(forecast)
?ma
Hope this helps,
Rui Barradas
Em 12-06-2013 08:21, Jie Tang escreveu:
Hi R users:
I have a big data and want to
Actually I am using rJava, running some map-reduce using R.
The data send is in bytes, but actually it is floating-point number.
On R side, I need to convert this byte into Float. But I couldn't find any
function.
I am try using rawToChar() which convert into character. And later on
as.double to
On 6/12/2013 1:03 AM, jonathan cornelissen wrote:
Hi,
I just wanted to share with you that we made a website over the weekend that allows
instant search of the R documentation on CRAN, see: www.Rdocumentation.org.
It's a first version, so any feedback/comments/criticism most welcome.
Tom,
Here is my solution. Note that I assume the columns are interleaved as you
describe below. I'm sure others will have better replies.
Note that using dput helps the helpers.
# From dput(mdat)
mdat-structure(list(x1 = c(2L, 2L, 2L, 3L, 3L, 30L, 32L, 33L, 33L),
y1 = c(100L, 100L, 100L,
On 13-06-12 6:54 AM, Bikash Agrawal wrote:
Actually I am using rJava, running some map-reduce using R.
The data send is in bytes, but actually it is floating-point number.
On R side, I need to convert this byte into Float. But I couldn't find any
function.
I am try using rawToChar() which
On Jun 11, 2013, at 20:26 , Mimi Celis wrote:
I am looking at the aov function in R. I see that it uses a modified QR
factorization routine dqrdc2 based on the Linpack routine dqrdc. Pivoting is
done different than the original Linpack function.
My questions:
* Why is it necessary
On Jun 12, 2013, at 09:47 , Gallon Li wrote:
i wish to change a column of factor variable to multiple columns of
zero-ones
for example, my factor could be
ff=c('a','a','b','b','c','c')
then I want to have two columns (for three levels) that are
0 0
0 0
1 0
1 0
0 1
0 1
how
Just because you have an editor that can let you see the organization within
the file does not mean the code itself is well-structured. If you do put a lot
of code in one file, you will be more likely in your next project that builds
on this one to load code you do not need (bloat), and that is
Great, thanks Arun, but I seem to be running into this error. Not sure what
did I miss.
result-data.frame(final_ouput[,-5],read.table(text=as.character(final_output$comment),sep=|,fill=TRUE,na.strings=),stringsAsFactors=FALSE)colnames(result)[5:7]-paste0(DataComment,1:3)
Error: unexpected symbol
Hugo Varet vareth...@gmail.com
on Tue, 11 Jun 2013 15:15:36 +0200 writes:
Dear Martin,
Thank you for your answer. Here is the exact call to agnes():
setwd(E:/Hugo)
library(cluster)
load(mydata.rda)
tableauTani-dist.binary(mydata, method = 4, diag = FALSE, upper
Hi,
I was trying to install the GGally package, but was getting errors. Here is
what I get:
install.packages(GGally)
Installing package(s) into â/Users/ts2w/Library/R/2.15/libraryâ
(as âlibâ is unspecified)
Warning in install.packages :
 package âGGallyâ is not available (for R
HI Shreya,
#Looks like you run the two line code as a single line.
result3-
data.frame(result2[,-5],read.table(text=as.character(result2$comment),sep=|,fill=TRUE,na.strings=),stringsAsFactors=FALSE)
colnames(result3)[5:7]- paste0(DataComment,1:3)
result3
# Row_ID_CR Data1
Ah that makes sense. This looks perfect now. Thanks for your help on this!
On Wed, Jun 12, 2013 at 9:10 AM, arun smartpink...@yahoo.com wrote:
HI Shreya,
#Looks like you run the two line code as a single line.
result3-
survreg allows interval censored data, if that is how you want to represent
measurement uncertainty. See
?Surv
-Original Message-
From: Kyle Penner [mailto:kpen...@as.arizona.edu]
Sent: Tuesday, June 11, 2013 8:02 PM
To: r-help@r-project.org
Subject: [R] survreg with measurement
Have a look at http://www.burns-stat.com/documents/tutorials/impatient-r/ . I
think the section on blank screen syndrome may help.
John Kane
Kingston ON Canada
-Original Message-
From: montana3...@gmail.com
Sent: Tue, 11 Jun 2013 16:59:34 -0700
To: ruipbarra...@sapo.pt
Subject:
I will assume that you are talking about uncertainty in the response. Then one simple way
to fit the model is to use case weights that are proprional to 1/variance, along with
+cluster(id) in the model statement to get a correct variance for this case. In linear
models this would be called
Thanks, I obviously read the help incorrectly. It does give the same results as
plotmatrix(dat1)
I take back some of the nasty thoughts I was thinking about ggpairs().
Any idea of the problem with RSudio? Keith notices the same speed difference
(but no crash) on a Mac while I'm runnng Ubuntu
HI,
You could also try:
dat2- dat1[-ncol(dat1)]
fun1- function(dat,value){
datNew- dat
n1- ncol(datNew)
indx1- seq(1,n1,by=2)
indx2- indx1+1
datNew[indx2][datNew[indx1] value]-NA
dat$output-rowMeans(datNew[indx2],na.rm=TRUE)
dat
}
fun1(dat2,10)
# x1 y1 x2
I would appreciate ideas about MS Windows install issues. I'm at our stats
summer camp and have been looking at a lot of Windows R installs and there
are some wrinkles about R_LIBS_USER.
On a clean Win7 or Win8 system, with R-3.0.1, we see the user library for
packages defaulting to
Thanks very much, John. This is very helpful.
Burnette
From: John Kane [via R] [mailto:ml-node+s789695n4669297...@n4.nabble.com]
Sent: Tuesday, June 11, 2013 5:35 PM
To: Crombie, Burnette N
Subject: Re: assigning global columns selection for all subset functions in
script
index the columns to
Dear all,
I am trying to install R and the Rcmdr package on a MacOSX 10.8.4.
It appears that I keep getting the error message Erreur : le chargement du
package ou de l'espace de noms a échoué pour 'Rcmdr' no matter what my
approach is. Even downloading XQuartz-2.7.4 did not help.
I found the
Dear all,
I am trying to run permutation tests for GLM using the glmperm package. When I
created my model,
I followed The R book and Mixed effects models and extensions in ecology with
R. In both books, response
variables were specified by using cbind(). That is, response variable is in a
Thanks, David. I appreciate your help. Your solution is the idea I also had
but wasn't quite sure if it was allowed in this case. That's a simple fix.
Burnette
From: David Winsemius [via R] [mailto:ml-node+s789695n4669295...@n4.nabble.com]
Sent: Tuesday, June 11, 2013 5:31 PM
To: Crombie,
Without context this is a shot in the dark, but my guess is this is
referring to something like a logistic regression where the odds ratio
(exponential of the coefficient) refers to the change in odds for the
outcome for a 1 unit change in x. Now often a 1 unit change in x is very
meaningful, but
Hi, Kejora here.
I didn't get your reply.
Tq,
Kejora
---
From: l...@asquote.com
To: r-h...@stat.math.ethz.ch
Date: 2013-06-07
Subject: Hi, can you supply tablet pc?
Hi. Kejora here.
I find you on google. Aere you doing distributing business?
We
[previously posted on Stack Overflow:
http://stackoverflow.com/questions/17034309/hiding-undocumented-functions-in-a-package-use-of-function-name
]
I've got some functions I need to make available in a package, and I don't want
to export them or write much documentation for them. I'd just hide
On 12/06/2013 10:44 AM, Bryan Hanson wrote:
[previously posted on Stack Overflow:
http://stackoverflow.com/questions/17034309/hiding-undocumented-functions-in-a-package-use-of-function-name
]
I've got some functions I need to make available in a package, and I don't want
to export them or
Dear Susanne,
Installation instructions for the Rcmdr are at
http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html,
but you've apparently done what you normally need to do to get it to work.
Though you don't say so, I assume that you have the latest versions of R
(3.0.1) and
I am not aware of any such command so, I think, you may have to write one
yourself:
invert the CDF and use uniform random variable (runif) to sample
Mikhail
On Tuesday, June 11, 2013 16:18:59 cassie jones wrote:
Hello R-users,
I am trying to simulate from truncated skew normal
Thanks Duncan...
Silly me, it's section 1.6.1 not version 1.6.1!
So this warning from check is not a problem in the long run:
* checking for missing documentation entries ... WARNING
Undocumented code objects:
‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ...
All user-level objects in a package should
Look at the filter() function.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Jie Tang
Sent: Wednesday, June 12, 2013 12:21 AM
To: r-help@r-project.org
Subject: [R]
[Replies transposed so as to achieve bottom-posting ... ]
On 12-Jun-2013 14:53:02 Greg Snow wrote:
On Tue, Jun 11, 2013 at 7:38 PM, vinhnguyen04x imvi...@yahoo.com.vn wrote:
Hi all
i have a question:
why and when do we use odds ratio per standard deviation instead of odds
ratio?
--
Dear Martin,
Thank you for your answer. I got the dist.binary() function in the ade4
package. It gives several distances for binary data. I agree with you, some
individuals probably share the same profile in my data.
Regards,
Hugo
[[alternative HTML version deleted]]
Hi everyone,
I have the following call to the barplot() function which produces the
desired stacked bar chart. HOWEVER, barplot() chooses 4 different shades of
gray for the stacks. If I want to use the legend=NULL argument in
combination with a separate call to legend() to customize the legend,
Dear list,
I have a problem with nested functions and I don't manage to get it
solved. I know I should be looking in environments, and I have tried a
lot, but it keeps on erroring.
An easy version of the problem is as follows:
innerfunction-function()
{
print(paste(a, from inner
Hello --
For convenience, I would like to use a two dimensional array
inside an inline C function. However, any numeric array in R
is passed to C code as double *. So, how can I cast a (double
*) to a double[][]?
thank you for your time,
Mikhail
[[alternative HTML version deleted]]
Hello,
See the help page for parent.frame, and use its argument to go back to
the frames of variables 'a' and 'b':
innerfunction-function()
{
env1 - parent.frame(1) # for 'b'
env2 - parent.frame(2) # for 'a'
print(paste(env2$a, from inner function))
print(paste(env1$b,
On Jun 12, 2013, at 12:37 PM, Dan Abner dan.abne...@gmail.com wrote:
Hi everyone,
I have the following call to the barplot() function which produces the
desired stacked bar chart. HOWEVER, barplot() chooses 4 different shades of
gray for the stacks. If I want to use the legend=NULL argument
A function looks up free variables in the environment in which the function
was defined, not in the environment in which the function was called. The
latter is called something like 'dynamic scoping' and usually leads to trouble,
the former is 'lexical scoping' and leads to predictable results.
grDevices::convertColor has arguments 'from' and 'to' which can take on value
'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity
coordinates that are also sometimes refered to as 'xyY' in the literature? Or
are these the CIE tristimulus values? It looks to me like the
On 12/06/2013 2:45 PM, Bryan Hanson wrote:
grDevices::convertColor has arguments 'from' and 'to' which can take on value
'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity
coordinates that are also sometimes refered to as 'xyY' in the literature? Or
are these the CIE
Bryan Hanson hanson at depauw.edu writes:
grDevices::convertColor has arguments 'from' and 'to' which can
take on value 'XYZ'. Can
someone confirm
that 'XYZ' is the same as the CIE chromaticity coordinates
are also sometimes refered to
as 'xyY' in
the literature? Or are these the CIE
Hello again,
Let say I have following user defined function:
Myfn - function(x) {
if (x 0) {
warning(Negative value)
}
return(x)
}
Now I want to create some function which will save the Warnings from
'Myfn', so that I can use those warnings later for more analysis. Therefore
I was thinking of
Hello everyone,
I'm trying to fit the PDF of time series datasets with the gamma distribution.
Nonetheless, this isn't possible for several datasets since the gamma
distribution can only been used to fit continuous distribution. For instance,
?withCallingHandlers
E.g.,
R f - function(expr) {
warnings - character()
withCallingHandlers(expr, warning=function(e){
warnings - c(warnings, conditionMessage(e))
invokeRestart(muffleWarning)
})
warnings
}
R f(1:10)
character(0)
R f(warning(Hmm))
[1] Hmm
Hi Terry,
Thanks for your quick reply. I am talking about uncertainty in the
response. I have 2 follow up questions:
1) my understanding from the documentation is that 'id' in cluster(id)
should be the same when the predictors are not independent. Is this
correct? (To be more concrete: my
Hi,
Try this:
set.seed(25)
dat1-
data.frame(A=sample(1:30,100,replace=TRUE),B=sample(1:35,100,replace=TRUE),C=sample(1:25,100,replace=TRUE))
dat1$pattern-with(dat1,ifelse(A20 B=2.5 C=20,Normal,ifelse(A 20 B
2.5 C 20,Increased,ifelse(A =20 B 2.5 C =20,Low,Other
head(dat1)
# A B C
Ken, I followed your suggestion and perhaps I don't understand what to expect
from convertColor or maybe I'm not using it correctly. Consider the following
tests:
D65 - c(0.3127, 0.329, 0.3583) # D65 chromaticity coordinates
X - D65[1]*D65[3]/D65[2] # conversion per brucelindbloom.com
Y -
You seem to treating the input values as xyY when they should be XYZ
(case matters).
So, I would do something like this
D65 - c(0.3127, 0.329, 0.3583)
X - 100 * D65[1]
Y - 100 * D65[2]
Z - 100 * D65[3]
XYZ - data.frame(X = X, Y = Y, Z = Z)
convertColor(XYZ, from = XYZ, to = sRGB)
[,1]
Thank you Ken.
90% of my problem was missing the factor of 100. I was just inputing xyY as a
test, I wasn't sure whether the docs were being clear about nomenclature.
Speaking thereof, the D65 values used in the example: I thought they were
chromaticity coordinates, but apparently they are
If they sum to 1 then they are one and the same. Look at how
chromaticity coordinates are defined in terms of the tristimulus
values.
Quoting Bryan Hanson han...@depauw.edu:
Thank you Ken.
90% of my problem was missing the factor of 100. I was just
inputing xyY as a test, I wasn't sure
Dear Susanne,
You started this thread on r-help (though R-SIG-Mac would have been more
appropriate), and so I'm copying my response to the r-help list. People will
find it confusing if the messages are simply kept private.
It's not obvious to me exactly what your problem is now. In particular,
Hi R users,
I am trying to fit a Mixed Markov Model and ran into trouble with maximizing
the log-likelihood function. I attached my R codes and the problem I have right
now is that the maximization may end in some local maximum by specifying
different start values. I am thinking if we can
Hello everyone,
I am extremely new to R. I have yet to write any complicated code myself,
however I have been learning largely by reading code that has already been
written. Long story short, I have been running a code that makes use of the
RPostgreSQL package for some time now. For some reason I
I'm adding a column (region) to a data frame (devUni8), and the (region)
column will be populated by a numeric code that is a function of another
column (state) in that data frame. See part of the script below.
How can I rewrite this so that I could apply the conditions to any data
frame
Le mercredi 12 juin 2013 à 16:52 -0400, John Fox a écrit :
Dear Susanne,
You started this thread on r-help (though R-SIG-Mac would have been more
appropriate), and so I'm copying my response to the r-help list. People will
find it confusing if the messages are simply kept private.
It's
If you want an easy way to change the name of the data frame for assignment
then you may want a macro. There is an article in the R journal (
http://cran.r-project.org/doc/Rnews/Rnews_2001-3.pdf) on creating macros
and there are tools that help with creating macros in the gtools package.
Though
Check out 'with' and 'within'.
Sent from my Verizon Wireless 4G LTE Smartphone
Original message
From: bcrombie bcrom...@utk.edu
Date: 06/12/2013 16:36 (GMT-05:00)
To: r-help@r-project.org
Subject: [R] rewrite script to eliminate constant object reference
I'm adding a
Hi,
Here are some examples using the mtcars dataset that you can modify to work
with your data.
## Here is my first try using within.
## Somehow the elements of region that
## should be zero are converted to NA
mtcars - within(mtcars, {
region - 0
region[gear==4carb==4] - 1
Hi,
Try this:
final3New-read.table(file=real_data_cecilia.txt,sep=\t)
final3New1-read.csv(real_data_cecilia_new.csv)
fun2-function(dat){
indx- duplicated(dat)|duplicated(dat,fromLast=TRUE)
dat1- subset(dat[indx,],dummy==1)
dat2- dat1[order(dat1$dimension),]
On 13/06/13 03:34, Bryan Hanson wrote:
SNIP
So this warning from check is not a problem in the long run:
* checking for missing documentation entries ... WARNING
Undocumented code objects:
‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ...
All user-level objects in a package should have
On Jun 12, 2013, at 16:34, Bryan Hanson han...@depauw.edu wrote:
Thanks Duncan...
Silly me, it's section 1.6.1 not version 1.6.1!
So this warning from check is not a problem in the long run:
* checking for missing documentation entries ... WARNING
Undocumented code objects:
Hi `Bangali`,
You can type in the R Console ?with()
?ifelse()
The details and some examples are there.
In addition to ?with(), you can use: ?within
dat1-within(dat1,pattern-ifelse(A20 B=2.5 C=20,Normal,ifelse(A 20
B 2.5 C 20,Increased,ifelse(A =20 B 2.5 C =20,Low,Other
Hi Rolf... Thanks. I discovered the approach you described by looking at the
source for spatstat, which as it turns out does exactly that. I also
discovered by testing that if you don't export a pattern, but rather export the
specific names, not including the functions one wants to hide,
Hey I want to identify data points by criteria, here is an example of my
1min data
Time Var1 Var2
00:001 0
00:010 0
00:021 0
00:031 0
00:040 0
00:051 0
00:061 0
00:07
On Jun 12, 2013, at 5:55 PM, Ye Lin wrote:
Hey I want to identify data points by criteria, here is an example of my
1min data
Time Var1 Var2
00:001 0
00:010 0
00:021 0
00:031 0
00:040 0
00:05
Hello,
If you carefully check the error message, it is clearly written:
RS-PostgreSQL.h:23:26: fatal error: libpq-fe.h: No such file or directory
Some header files are missing.
Here is the result of a quick search on the web: libpq-dev for Ubuntu.
If I may suggest, you should upgrade the
L. Snow,
Ted,
Many thanks, I am sorry to made a question without context. I use three
parameters of facial temperature, heart rate, and respiratory rate to
distinguish infectious patients from healthy subjects. So I use logistic
regression to generate a classification model and calculate the odds
Hi,
Not clear about the 'Time' column.
dat1- read.table(text=
Time Var1 Var2
00:00 1 0
00:01 0 0
00:02 1 0
00:03 1 0
00:04 0 0
00:05 1 0
00:06 1 0
00:07 1 0
00:08
79 matches
Mail list logo