Thanks for your responses.
I have already found that "merge" function performs what I am looking for.
On Fri, Jun 14, 2013 at 12:51 AM, Yasin Gocgun wrote:
> Hi,
>
> I have been struggling with the issue of merging data frames that have
> common columns and have different dimensions. Although I
?merge
Sent from my iPad
On Jun 14, 2013, at 0:51, Yasin Gocgun wrote:
> Hi,
>
> I have been struggling with the issue of merging data frames that have
> common columns and have different dimensions. Although I made alot of
> search about it on internet, I could not find any function that woul
Hi,
I try to build a toy package by running the following codes in an R
program
require(stats)
f <- function(x,y) x+y
g <- function(x,y) x-y
d <- data.frame(a=1, b=2)
e <- rnorm(1000)
package.skeleton(list=c("f","g","d","e"), name="test1pkg",
path="D:/R/pkgtest")
Then the program runs smoot
Dear R users,
I use: mapImageData<- get_map(source="google", c(lon=21, lat=57), zoom=6,
maptype="terrain")
to get ggmapTemp.png file in the directory. The problem is - some city and
park names overlay with my data points I want to plot on this map. Is there
a way to get the map without city, coun
Hi,
I have been struggling with the issue of merging data frames that have
common columns and have different dimensions. Although I made alot of
search about it on internet, I could not find any function that would
efficiently perform the required operation. So I would appreciate if anyone
knowing
Hi,
Check if this works for you:
source("Ye_data.txt")
dim(dat1)
library(xts)
xt1<- xts(dat1[,-1],strptime(dat1[,1],"%m/%d/%Y %H:%M"))
xtSub<-xt1["T00:00:00/T08:00:00"]
lst1<-split(xtSub,as.Date(index(xtSub)))
res<- do.call(rbind,lapply(lst1,function(x){indx<-
which(rowSums(x)==0);x[indx[which.m
yes ,Ma in forecast package does works but when the data included NA,NAN or
INF ,it could not go on calculating the running
2013/6/12 Rui Barradas
> Hello,
>
> You can use, for instance, function ma() in package forecast.
>
> # if not yet installed
> #install.packages('forecast', dependencies =
Thanks, David, I appreciate your help.
--
View this message in context:
http://r.789695.n4.nabble.com/odds-ratio-per-standard-deviation-tp4669315p4669501.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing li
On Jun 13, 2013, at 2:21 PM, Bert Gunter wrote:
> Lorenzo:
>
> 1. This is a statistics question, not an R question.
>
> 2. Your statistical background appears inadequate -- it looks like
> Poisson regression, which would fall under "generalized linear
> models". But it depends on how "discrete
Please ignore my previous message.I was able to figure out a solution..
here it is..
nlen <- function(x) length(na.omit(x))
tabular(((p=factor(p))*(a=factor(a))+1) ~ (b + c)*
((N=nlen)+mean+sd),data=a)
Thanks,
Santosh
On Thu, Jun 13, 2013 at 4:16 PM, Santosh wrote:
> Dear Rxperts,
>
> I
Dear Rxperts,
Is there a way to exclude NAs while computing the summary statistics using
"tables" package?
I would also like the "count" (length(x,na.rm=T) included for each column
...
a <- data.frame(p=rep(c("A","B"),each=10,len=30),
a=rep(c(1,2,3),each=10),id=seq(30),
b=round(log(runif(30,-10,
I asked a similar question earlier in the year,
http://r.789695.n4.nabble.com/How-to-stop-set-seed-besides-exiting-out-of-R-td4661717.html
I liked this solution from William,
> rm(list=".Random.seed", envir=globalenv())
Mike
On Thu, Jun 13, 2013 at 5:27 PM, Michael Weylandt
wrote:
>
>
> On Jun
On Jun 13, 2013, at 18:32, Duncan Murdoch wrote:
> On 13/06/2013 11:59 AM, Pooya Lalehzari wrote:
>> Hello,
>> If I use set.seed(x) to set a seed for the random number generator, how can
>> I undo that to revert a random output every time I run my code?
>
> If you remove .Random.seed, then th
Lorenzo:
1. This is a statistics question, not an R question.
2. Your statistical background appears inadequate -- it looks like
Poisson regression, which would fall under "generalized linear
models". But it depends on how "discrete" discrete is (on some level,
all measurements are discrete, dis
Dear All,
I am struggling with a linear model and an allegedly trivial data set.
The data set does not consist of categorical variables, but rather of
numerical discrete variables (essentially, they count the number of times
that something happened).
Can I still use a standard linear regressi
Hi,
May be this helps:
source("Ye_data.txt")
dim(dat1)
#[1] 44640 3
library(xts)
xt1<- xts(dat1[,-1],strptime(dat1[,1],"%m/%d/%Y %H:%M"))
xtSub<-xt1["T00:00:00/T08:00:00"]
dim(xt1)
#[1] 44640 2
dim(xtSub)
#[1] 14911 2
lst1<-split(xtSub,as.Date(index(xtSub)))
sapply(lst1,function(x)
Hi Spencer,
Thanks for the pointers.
> > 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.
>
>
>
See Lumley's text "Complex Surveys", chapter 9: "Missing Data". In addition to
the survey package he also uses teh RSQLite and mitols packages in his worked
examples. He doesn't use the NHIS data for the missing data chapter, but he
does provide examples using NHIS for other tasks.
--
David.
R users have a few choices of how to connect to their Oracle Database.
The most commonly seen include: RODBC, RJDBC, and ROracle. However,
these three packages have significantly different performance and
scalability characteristics which can greatly impact application
development. This blog ar
Could you share the results of sessionInfo() and str(alllev)?
Also please share the exact in- and output with relevant error
messages; for example 'cntnew:male' does not make much sense without
context.
Unfortunately I don't understand your model specification and is lost
in the interpretation of
I paln on using R to do the imputation once I figure out how to do it.
- Original Message -
From: Bert Gunter
To: Scott Raynaud
Cc: "r-help@r-project.org"
Sent: Thursday, June 13, 2013 12:45 PM
Subject: Re: [R] Survey imputation
Is this an R question?
Seems like it belongs on a stat
look up imputation on survey data might be helpful
On Thu, Jun 13, 2013 at 10:45 AM, Bert Gunter wrote:
> Is this an R question?
>
> Seems like it belongs on a statistical or survey list, not r-help.
>
> Cheers,
> Bert
>
> On Thu, Jun 13, 2013 at 10:37 AM, Scott Raynaud
> wrote:
> > I'm working
Is this an R question?
Seems like it belongs on a statistical or survey list, not r-help.
Cheers,
Bert
On Thu, Jun 13, 2013 at 10:37 AM, Scott Raynaud wrote:
> I'm working with NHIS survye data. I'd like the to use muliple imputation
> to cover the missing data for the variables in which I'm i
I'm working with NHIS survye data. I'd like the to use muliple imputation
to cover the missing data for the variables in which I'm interested. My
question concerns the use of certain variables in the imputation model.
For example, race would be an important predictor in the imputation
model,
On 13/06/2013 1:26 PM, Raffaello Vardavas wrote:
Dear All,
this may be a trivial problem. A collaborator has created an R package for
internal use (not available on CRAN). This installs and works fine on my Mac
but fails to install on windows.
When I install the packagein windows by brow
What evidence do you have that the package did not install? The only
differences in the output that you show is that in the second case you get
extra output about downloading the package which does not apply in the
first case since you did not need to download the package.
On Thu, Jun 13, 2013 a
On 13/06/2013 11:59 AM, Pooya Lalehzari wrote:
Hello,
If I use set.seed(x) to set a seed for the random number generator, how can I
undo that to revert a random output every time I run my code?
If you remove .Random.seed, then the next time a seed is needed it will
be generated from the syste
Hi, I am using an Lenovo Thinkpad with Ubuntu and 5.5Gb of RAM.
I am running against a memory ceiling.
Upon starting R the following command executes, but
the system monitor tells me that R is now using 2.4 GB, and
gc() agrees with that:
> m=matrix(data=1,ncol=18e3,nrow=18e3)
> gc()
Dear All,
this may be a trivial problem. A collaborator has created an R package for
internal use (not available on CRAN). This installs and works fine on my Mac
but fails to install on windows.
When I install the packagein windows by browing and pointing to the .zip file I
get the followin
Your shapefile should include specifications for its coordinate system.
Look for a file names maryland.prj in the same directory as maryland.shp.
And that coordinate system should be included in your 'border' object. You
might need to change to using readOGR() to load the shapefile into R. Use
s
HI,
Please check this link
(http://r.789695.n4.nabble.com/Remove-levels-td4669441.html). It was posted
today.
df1<-subset(df, Trt!="blank")
df2<- df1
df1$Trt<- factor(df1$Trt)
levels(df1$Trt)
#[1] "Trt1" "Trt2"
#or
df2$Trt<-droplevels(df2$Trt)
levels(df2$Trt)
#[1] "Trt1" "Trt2"
A.K.
Hey
Hello,
If I use set.seed(x) to set a seed for the random number generator, how can I
undo that to revert a random output every time I run my code?
Thanks,
Pooya.
THIS E-MAIL IS FOR THE SOLE USE OF THE INTENDED
RECIPIENT(S) AND MAY CONTAIN CONFIDENTIAL AND
PRIVILEGED INFORMATION.
ANY UNAUTHORI
Yep, that's it. Thanks a lot for the replies I got.
I guess the point I was struggling with (as I was curve fitting a distribution
to sample data) is the discrete vs continuous densities.
But if one wants to model sample densities with a continuous, say normal,
distribution then the histogram sho
within(mtcars,{ x<-rep(0,nrow(mtcars));x[gear==4]<-1;x[gear==3]<-2}) #should
fix this;
A.K.
- Original Message -
From: Ista Zahn
To: Bert Gunter
Cc: r-help@r-project.org
Sent: Thursday, June 13, 2013 12:17 PM
Subject: Re: [R] puzzling behavior of within
On Thu, Jun 13, 2013 at 12:11
On Thu, Jun 13, 2013 at 12:17 PM, Ista Zahn wrote:
> On Thu, Jun 13, 2013 at 12:11 PM, Bert Gunter wrote:
>> Why are you surprised?
>
> Because I missed the significance of "examines the environment after
> the evaluation of 'expr' and makes the corresponding modifications to
> 'data'" in ?within
On Thu, Jun 13, 2013 at 12:11 PM, Bert Gunter wrote:
> Why are you surprised?
Because I missed the significance of "examines the environment after
the evaluation of 'expr' and makes the corresponding modifications to
'data'" in ?within, and thought my example should be equivalent to
mtcars <- wi
Why are you surprised? It has nothing to do with within() . ?"[<-"
> x <- 0
> g <- 1:2
> x[g==1]<- 5
> x
[1] 5 NA
-- Bert
On Thu, Jun 13, 2013 at 9:00 AM, Ista Zahn wrote:
> Hi all,
>
> In answering a question yesterday about avoiding repeatedly typing the
> name of a data.frame when making mo
Frequently Asked Questions 7.31 Why doesn't R think these numbers
are equal?
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think
-these-numbers-are-equal_003f
For more details read the First Circle of the R Inferno:
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf
R FAQ 7.31.
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
On Thu, Jun 13, 2013 at 11:47 AM, Filippo Monari wrote:
> Hi,
> anyone can explain to me the following?
>
>> rho
> [1] 0.9452398 0.8792735 0.9641829 0.9876954 0.9993560 0.9826084 1.
Hi all,
In answering a question yesterday about avoiding repeatedly typing the
name of a data.frame when making modifications to it I discovered the
following unexpected behavior of within:
mtcars <- within(mtcars, {
x <- 0
x[gear==4] <- 1
})
generates a column named x in mtcars equal to
Density means that the AREAS of the bars add to 1, not the HEIGHTS
of the bars. You probably have intervals that are less than 1. Eg:
> set.seed(42)
> x <- rpois(1000, 5)/100
> info <- hist(x, prob=TRUE)
> info
$breaks
[1] 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11
0.12 0.13
$co
Thanks David! I will pay attention to the format later. This is not
homework exercise, I am just providing a mimic sample of my actual data and
as I described in the original post, this is 1min data so the time interval
is 1 min.
On Wed, Jun 12, 2013 at 6:20 PM, David Winsemius wrote:
>
> On Jun
Hi,
anyone can explain to me the following?
> rho
[1] 0.9452398 0.8792735 0.9641829 0.9876954 0.9993560 0.9826084 1.000
[8] 1.000 0.7982916 1.000 0.3361956
> any(rho >= 1)
[1] FALSE
thanks, regards
Filippo
__
R-help@r-project.org mailin
Hi,
On Thu, Jun 13, 2013 at 11:13 AM, Mohamed Badawy wrote:
> Hi... I'm still a beginner in R. While doing some curve-fitting with a raw
> data set of length 22,000, here is what I had:
>
>
>
>> hist(y,col="red")
>
> gives me the frequency histogram, 13 total rectangles, highest is near 5000.
>
Freetype 2.4.12 was released in early May. Just so that we are clear that this
is a freetype bug which affects R's use of Cairo (among other things). So there
are updated bundles, and also bundles for Mac OS X as well, for both a patched
2.4.11 and 2.4.12 proper. The accompanying *.txt has a lis
Hi,
You could use:
?grep
grep("ARUN",MyDat[,1])
#[1] 2
#or
library(stringr)
which(!is.na(str_match(MyDat[,1],"ARUN")))
#[1] 2
vec1<-c(MyDat[,1],"ARUN003","Arun")
which(!is.na(str_match(toupper(vec1),"ARUN")))
#[1] 2 10 11
A.K.
- Original Message -
From: R_Antony
To: r-help@r-projec
Thanks very much to everyone for their replies, especially Ista, who took the
time to write script. Before posting the question I had tried attach() and then
within or with statements and now know why those generated errors. Some of my
syntax was incorrect. Thanks for clearing that up. "Within"
Hi... I'm still a beginner in R. While doing some curve-fitting with a raw data
set of length 22,000, here is what I had:
> hist(y,col="red")
gives me the frequency histogram, 13 total rectangles, highest is near 5000.
Now
> hist(y,prob=TRUE,col="red",ylim=c(0,1.5))
gives me the density
Thank you for the reply, I appreciate it very much.
I have the following responses:
sudo R CMD INSTALL ~/APX.X.X/Rserve_0.6-2.tar.gz
Explaining what 'does not work' means.
When I type this in. It says that the package is not found. Can you
guide me as to what I need to do here?
What vers
val_w_time <- data.frame(time = 1:12,
val = c(24,7,4,1,2,1,0,0,0,1,0,0))
fitdistr(val_w_time$val,"gamma")
# Error in optim(x = c(24, 7, 4, 1, 2, 1, 0, 0, 0, 1, 0, 0), par = list( :
# initial value in 'vmmin' is not finite
# this error message doesn't necessari
Also, if the ids are ordered and numeric:
which(c(1,diff(ds[,1]))>0)
#[1] 1 4 9
A.K.
- Original Message -
From: arun
To: Gallon Li
Cc: R help
Sent: Thursday, June 13, 2013 9:40 AM
Subject: Re: [R] find the position of first observation for each subject
HI,
Try this:
ds1<- data.frame
If you've read the R Inferno section, you already know that
following my example with
> levels(DATA$UnitName_1)
[1] "lake" "pond" "river"
> DATA$UnitName_1 <- factor(DATA$UnitName_1)
> levels(DATA$UnitName_1)
[1] "pond" "river"
removes the empty factor level.
-
Hi,
Not sure if the OP is concerned about this:
Using David's data
str(DATA)
#'data.frame': 15 obs. of 2 variables:
# $ UnitName_1: Factor w/ 3 levels "lake","pond",..: 3 3 1 3 2 2 3 1 2 3 ...
#$ Var : int 95 97 12 47 54 86 14 92 88 8 ...
toBeRemoved1 <- which(DATA$UnitName_1=="lake"
Hi
The example contained errors in the line with cast and it is too late to check
without a reproducible example i am only guessing
perhaps add a groups argument and supply a col argument to superpose polygon eg
groups = Ikeda,
par.settings = list(superpose.polygon = list(col = 12 colours to s
Hi,
Without more information I guess your problem is that the level name
still exists in the factor whereas it doesn't appear anymore in the
factor. If so, try droplevels.
Alain Guillet
On 13/06/13 14:02, Shane Carey wrote:
> I have a dataframe consisting of factors in one column. Im trying t
Works fine for me. Too bad you didn't include actual data:
> set.seed(42)
> DATA <- data.frame(UnitName_1=factor(sample(c("lake", "pond",
"river"),
+ 15, replace=TRUE)), Var=sample.int(100, 15))
> DATA
UnitName_1 Var
1 river 95
2 river 97
3lake 12
4 river 4
Please read the Posting Guide, which among other things points out that you
should be posting in plain text format, not HTML (which tends to corrupt
example R code).
Then please explain why your problem is not addressed by the below referenced
section of the R Inferno. You may need to read [1]
HI,
Try this:
ds1<- data.frame(id,time)
which(with(ds1,ave(time,id,FUN=seq))==1)
#[1] 1 4 9
A.K.
- Original Message -
From: Gallon Li
To: R-help@r-project.org
Cc:
Sent: Thursday, June 13, 2013 3:56 AM
Subject: [R] find the position of first observation for each subject
suppose I have
Nope, but thanks
On Thu, Jun 13, 2013 at 1:11 PM, Albin Blaschka <
albin.blasc...@standortsanalyse.net> wrote:
>
>
> Am 13.06.2013 14:02, schrieb Shane Carey:
>
> I have a dataframe consisting of factors in one column. Im trying to
>> remove
>> certain levels using the following code:
>> toBeRe
It seems a line through the origin doesn't fit the data very well. That may be
throwing off the fitting routine.
data = c(144.53, 1687.68, 5397.91)
err = c(8.32, 471.22, 796.67)
model = c(71.60, 859.23, 1699.19)
id = c(1, 2, 3)
# display
plot(data ~ model)
library("Hmisc")
errbar(model, add=TRU
Am 13.06.2013 14:02, schrieb Shane Carey:
I have a dataframe consisting of factors in one column. Im trying to remove
certain levels using the following code:
toBeRemoved1<-which(DATA$UnitName_1=="lake")
DATA<-DATA[-toBeRemoved1,]
However it will not remove the level "lake"
Hello!
Is this a
I have a dataframe consisting of factors in one column. Im trying to remove
certain levels using the following code:
toBeRemoved1<-which(DATA$UnitName_1=="lake")
DATA<-DATA[-toBeRemoved1,]
However it will not remove the level "lake"
In the past this worked for me, but its not working now. Any hel
Thanks that done the trick.
Cheers
On Thu, Jun 13, 2013 at 10:59 AM, Rui Barradas wrote:
> Hello,
>
> Something like this?
>
>
> x <- runif(100, min = 2, max = 10)
> boxplot(x, ylim = c(0, max(x)))
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 13-06-2013 10:02, Shane Carey escreveu:
>
> Hi,
>
Hello,
Something like this?
x <- runif(100, min = 2, max = 10)
boxplot(x, ylim = c(0, max(x)))
Hope this helps,
Rui Barradas
Em 13-06-2013 10:02, Shane Carey escreveu:
Hi,
I have a Tukey boxplot y-axis starting at 2.5, how do I force it's y-axis
to start a t zero
Thanks
__
Hi,
I have a Tukey boxplot y-axis starting at 2.5, how do I force it's y-axis
to start a t zero
Thanks
--
Shane
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
On Thu, Jun 13, 2013 at 6:26 AM, L S wrote:
> I realized that the coordinates are completely different. The coordinates
> in my data file (i.e. my csv file) are traditional GPS coordinates (e.g. 39.17
> or 76.37). The shapefile however has x,y values such as 1416813.54262877
> or 561125.5466027
which(!duplicated(ds[, "id"]))
Chris Campbell, PhD
Tel. +44 (0) 1249 705 450 | Mobile. +44 (0) 7929 628 349
mailto:ccampb...@mango-solutions.com | http://www.mango-solutions.com
Mango Solutions, 2 Methuen Park, Chippenham, Wiltshire , SN14 OGB UK
-Original Message-
From: r-help-boun...@r
suppose I have the following data
id=c(rep(1,3),rep(2,5),rep(3,4))
time=c(seq(1,3),seq(2,6),seq(1,4))
ds=cbind(id,time)
> ds
id time
[1,] 11
[2,] 12
[3,] 13
[4,] 22
[5,] 23
[6,] 24
[7,] 25
[8,] 26
[9,] 31
[10,] 32
[11,] 33
[12
Hello,
?grep
> grep('ARUN', MyDat$NAME)
[1] 2
Regards,
Pascal
On 13/06/13 16:08, R_Antony wrote:
Hi
Here i have a dataframe called MyDat.
MyDat<- data.frame(NAME = c("ANTONY001", "ARUN002", "AKBAR003",
"JONATHAN004", "PETER005", "AVATAR006", "YULIJIE007", "RAM008",
"DESILVA009"),
COL_A =
Hi
Here i have a dataframe called MyDat.
MyDat<- data.frame(NAME = c("ANTONY001", "ARUN002", "AKBAR003",
"JONATHAN004", "PETER005", "AVATAR006", "YULIJIE007", "RAM008",
"DESILVA009"),
COL_A = c(0, 0, 0, 1, 0, 1, 2, 3, 1),
COL_B = c(0, 3, 0, 3, 3, 1, 0, 1, 2),
COL_C = c(1, 2, 3, 1, 2, 3, 1, 2
On 13/06/2013 05:09, Derek Serianni wrote:
Hi,
I am new to linux so please bear with me.
OS is CentOS 5.9 - This cannot be changed
I am following a guide given to me to setup a server.
I am told to do the following:
To Install R:
sudo yum install gcc
sudo yum install make
sudo yum install
71 matches
Mail list logo