Hello,
Suppose that you have a data frame 'df' with variables 'V1', 'V2', 'V3',
etc.
Is there any (performance) difference (except the difference of the return
types)
between the following two computations?
subset(df, V1 > 0, V2)
and
df$V2[df$V1 > 0]
Best Regards,
hyunjo
[[alternati
Thanks Duncan for your input. However I could not install the package
"RHTMLForms", it is saying as not not available :
> install.packages("RHTMLForms", repos = "http://www.omegahat.org/R";)
Warning in install.packages("RHTMLForms", repos =
"http://www.omegahat.org/R";) :
argument 'lib' is mis
Bogaso wrote:
> Thank you so much for those helps. However I need little more help. In the
> site
> "http://www.rateinflation.com/consumer-price-index/usa-historical-cpi.php";
> if I scroll below then there is an option "Historical CPI Index For USA"
> Next if I click on "Get Data" then another t
The best reference I know for this is something I wrote with Jim
Ramsay and Giles Hooker: Functional Data Analysis with R and Matlab
(Springer, 2009). Others may have better material.
After "install.packages('fda')", I suggest you try
"system.file('scripts', package='fda')", as s
Lars Bishop wrote:
Dear R experts,
The lrm function in the Design package can perform penalized (Ridge)
logistic regression. It is my understanding that the ridge solutions are not
equivalent under scaling of the inputs, so one normally standardizes the
inputs. Do you know if input standardizati
#same shape
some_data <- rgamma(500,shape=6,scale=2)
test_data <- rgamma(500,shape=6,scale=2)
plot(sort(some_data),sort(test_data))
# You can also use qqplot(some_data,test_data)
abline(0,1)
# different shape
some_data <- rgamma(500,shape=6,scale=2)
test_data <- rgamma(500,shape=4,scale=2)
plot(
On Sep 25, 2009, at 8:33 PM, Lars Bishop wrote:
Dear R experts,
The lrm function in the Design package can perform penalized (Ridge)
logistic regression. It is my understanding that the ridge solutions
are not
equivalent under scaling of the inputs, so one normally standardizes
the
inputs.
Is this what you want:
> coef.y
(Intercept)
1 0.03109602
2 0.03109602
3 0.03109603
4 0.03109602
> str(coef.y)
Classes ‘coef.lme’, ‘ranef.lme’ and 'data.frame': 4 obs. of 1 variable:
$ (Intercept): num 0.0311 0.0311 0.0311 0.0311
- attr(*, "level")= int 1
- attr(*, "label")= chr "C
I am still fairly new to R and have a fairly rudimentary question. I am
trying to name a vector of coefficients retrieved from a multilevel model
using the coef function. I guess the default name is "Intercept" and I
cannot figure out how to rename it.
I have tried the using the code below
LOL Rolf. Yes I am sure it isn't homework. I am working on an aeroacoustics
problem and was trying to figure out how to implement a fourier transform in
R. I normally don't work in this field so this stuff was new to me at the
time of writing. I have since figured it out.
Unfortunately I don't ha
Dear R experts,
The lrm function in the Design package can perform penalized (Ridge)
logistic regression. It is my understanding that the ridge solutions are not
equivalent under scaling of the inputs, so one normally standardizes the
inputs. Do you know if input standardization is done internally
Greg and Marc,
Not that it's needed here but, of course, perm.test() in
pkg:exactRankTests or oneway_test() in pkg:coin can be
used.
Using Marc's / Greg's computations, the (two-sided) p-value
is
sum(abs(perms) >= abs(orig)) / length(perms)
[1] 0.01937395
perm.test() and oneway_test give a
zubin-2 wrote:
>
>
> how do i evaluate this whole list to a single boolean True or False? If
> any of these are true the whole statement is True, else False. this
> only seems to work for the first ticker, the rest don't perform the
> operations within the loop.
>
>
Try %in%
tname %in
Hello, writing some R code to cleanse a data set, if the following set
of symbols are identified then perform some actions. trying to write
the minimum code to do this.
tname = "VIX"
checkticker = c("VIX", "TYX", "TNX", "IRX")
if (tname == checkticker) {
//perform some operations
Hello,
Â
Could someone tell me please how can I find out which starting values has R
used for the simulation?
Â
I have AR(1) model:
Â
y(t)=0.2*y(t-1)+0.2*y(t-2) + e(t) Â
Â
(e(t) is distributed according standard normal distribution)
Â
I need y(0) (or y(t-1), then t=1)Â values for my follow
Hello, I am struggling with R and have little experience. I need help or
suggestions to create a multi-objective program. I have a table as follows
http://www.nabble.com/file/p25615459/smallmodel01.xls smallmodel01.xls
My constraints are subject to each origin, their corresponding numbers and
th
On Sep 21, 2009, at 12:19 PM, Cynthia Sadler wrote:
Hi,
I'm trying to read data from a collection of CSV files for
processing and graphing. All of my files begin with "modrate" and
end with ".csv". I think I have the regex working but I am stumped
at trying to get read.table to work with
Does this work for you?
data_list <- list()
filepattern="modrate*"
all_files <- list.files(pattern=filepattern)
data_list <- lapply(all_files, read.table,header=TRUE,sep=",")
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
I am trying to understand NLM package, so I generated this data set consisting
y and x using
y= a + b*x +c*x^2 + N(0,10), with a=3.5,b=4.5,c=5.5
Given y and x, I am trying to use NLM to have estimates of parameters a, b and
c that minimize the least square error
my code looks like
f<- fu
Try this:
foo <- function(expr, x){
eval(substitute(expr))
}
foo(x^2, 4)
foo(x^3-10, 2)
On Fri, Sep 25, 2009 at 6:16 PM, njhuang86 wrote:
>
> Hi. I was wondering how I can write a function that generates the outcome
> values for a user specified equation. For example, function(x^2, 4) w
Hi. I was wondering how I can write a function that generates the outcome
values for a user specified equation. For example, function(x^2, 4) will
return back 16 and function(x^3 - 10, 2) will give back -2...
I've been playing around with various lines of code but somehow, I just
cannot get R to
Hi,
Suppose that there are multiple files in a .gz file. How to open only
one file in it? I don't find such options in the help.
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
or that! :-D thanks jim.
b
On Sep 25, 2009, at 3:57 PM, jim holtman wrote:
Here is how much time it took to read a file with 10 lines and 700,000
columns per line separated with comma:
system.time(input <- scan("/tempxx.txt", what=0, sep=','))
Read 700 items
user system elapsed
15.62
Dear R-ers,
need your advice on hardware (beware - I am not knowledgeable about that).
I find R runs wonderfully on laptops. In my company, we decided to get
some kind of a powerful computer (server?) so that we could run big
jobs on it (e.g., in R, SAS, SPSS, Excel). We were thinking of
somethin
Here is how much time it took to read a file with 10 lines and 700,000
columns per line separated with comma:
> system.time(input <- scan("/tempxx.txt", what=0, sep=','))
Read 700 items
user system elapsed
15.620.22 15.84
> object.size(input)
5624 bytes
>
'scan' should be suff
Thanks Marc,
The sampling is so easy that I often forget that we can do the exact
permutation test for smaller samples (and I can never remember when small is
small enough for this). With the exact permutations we really don't need to do
the prop.test or binom.test, I usually do that to get th
Henrique:
It worked nicely, I am using IE 6.0. Thanks a lot for your help
--- On Fri, 9/25/09, Henrique Dallazuanna wrote:
> From: Henrique Dallazuanna
> Subject: Re: [R] How to download from github
> To: "Felipe Carrillo"
> Cc: "Charlie Sharpsteen" , r-help@r-project.org
> Date: Friday, Sep
it may be worth it writing a script to transpose the data (in awk, it
takes 10min on my laptop)... then read in the transposed data...
> system.time({x <- read.delim("testTransposed.txt", header=F,
colClasses="numeric", nrow=70); x <- t(x)})
user system elapsed
4.958 0.412 5.4
Greg and John,
Just to throw it out there, the data sets here are small enough that
you co do a fully enumerable permutation test by replacing your
replicate() call with:
perms <- combn(17, 9, function(x) median(sets[x]) - median(sets[-x]))
This is based on an off-list communication that
What is browser that you are using to download?
Try the direct link to download:
http://github.com/hadley/ggplot2-bayarea/zipball/0a8bf71dea38cfbf2d928eb713d24dfd928359fc
On Fri, Sep 25, 2009 at 3:07 PM, Felipe Carrillo
wrote:
> That's strange, my pc is not that slow, it has 3 mb of Ram. The
You could use grep, but it's probably easier to use %in% (see also
is.element()), e.g.:
house_info[ house_info[,1] %in% c("Water damage", "water pipes damaged", "leaking
water"), ]
water_evaluation.water_evaluation_selection. house_number
6 water pipes damaged
That's strange, my pc is not that slow, it has 3 mb of Ram. The download button
doesn't respond either using my computer at work or at home. When you click the
download button, Do you get a dialog box prompting you where to save the files?
--- On Thu, 9/24/09, Charlie Sharpsteen wrote:
> From:
Say I have the following data:
house_number<-floor(runif(100, 200, 600))
water_evaluation<-c("No water damage", "Water damage", "Water On", "Water off",
"water pipes damaged", "leaking water")
water_evaluation_selection<-floor(runif(100, 1,6))
house_info<-data.frame(water_evaluation[water_evalua
On Fri, Sep 25, 2009 at 10:18 AM, Henrik Bengtsson
wrote:
> You can use R.utils (on CRAN) to help you figure out why the file is
> not found or not readable.
>
> library("R.utils");
> pathname <- C:/Documents and Settings/ashta/My Documents/R_data/rel.dat";
> pathname <- Arguments$getReadablePath
You can use R.utils (on CRAN) to help you figure out why the file is
not found or not readable.
library("R.utils");
pathname <- C:/Documents and Settings/ashta/My Documents/R_data/rel.dat";
pathname <- Arguments$getReadablePathname(pathname);
rel <- read.table(pathname, quote="", header=FALSE, sep
On Fri, 25 Sep 2009, Ping-Hsun Hsieh wrote:
Thanks, Ben.
The matrix is a pure numeric matrix (6x70, 31mb).
I tried the colClasses='numeric' as well as nrows=7(one of these is header
line) on the matrix.
Also I tested it with not setting the two options in read.delim()
A couple of things
Use polr from the MASS package
Nimal Fernando
Sent by: r-help-boun...@r-project.org
09/25/2009 12:33 PM
To
r-help@r-project.org
cc
Subject
Re: [R] Logistic Regression for Multinomial Data using R
Hi
I want to do logistic regression for multinomial data.
How can I do it in R?
Thanks
Yes, I agree that the median makes the most sense here, but there could be
other measures of location that would be of interest (quartiles, some version
of the rank sum).
Here is some sample code for a permutation test on the medians (there are a
couple of packages that will do this as well, bu
How can I get the the standard error and confidence interval for the
prediction in a multiple regression model using the R command?
for a simple regression I used
*predict(xc, newdata=data.frame(var1=10.),se=T)
where xc is the glm model using binomial and var1 is teh variable.
*
I can get the u
Thanks, Ben.
The matrix is a pure numeric matrix (6x70, 31mb).
I tried the colClasses='numeric' as well as nrows=7(one of these is header
line) on the matrix.
Also I tested it with not setting the two options in read.delim()
Here is the time spent on reading the matrix for each test.
>syste
Hi
I want to do logistic regression for multinomial data.
How can I do it in R?
Thanks a lot
Nimal Fernando
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
UseRs,
I am working on the analysis of green area growth in winter wheat and the
effects of the amount of water on it. I am trying to fit a asymmetric
logistic peak curve to my data as described by Royo et al., Europ. J Agronomy
20 (2004) 419. I want to calculate the maximum green area, maxim
I am getting the following errors when I am trying to plot the data below. I
cannot figure out the error.
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to ma
try this:
> lines<-"lo ptcl5 ptcl99 variable
+ 430. 8787a
+ 430 3422343 m
+ 430. 89mr
+ 4314564774a
+ 431 299 2777m
+ 4319996 mr
+ 432
Dear R User,
I am an electrical engineering student and have just come across a curve
fitting problem. I need to find the constituent Gaussian distribution curves
fitting the data attached in Workbook1.txt here. I tried to use Mixdist on R
but ran into following problem. Can you suggest me wher
On Fri, Sep 25, 2009 at 7:55 AM, baptiste auguie
wrote:
> Thank you Paul, I was convinced I tried this option but I obviously didn't!
>
> In ?packGrob, the user is warned that packing grobs can be slow. In
> order to quantify this, I made the following comparison of 3
> functions,
>
> - table1 use
Sometimes it is easiest to open a file using a file selection
widget. I keep this in my .Rprofile:
getOpenFile <- function(...){
require(tcltk)
return(tclvalue(tkgetOpenFile()))
}
With this you can find your file and open it with
rel <- read.table(getOpenFile(), quote="", header=FALSE, s
I have been trying using the following
require(multcomp)
tmp <- list(confint=sig.data)
attr(tmp, "type") <- "none"
old.oma <- par(oma=c(0,1,0,0))
multcomp:::plot.confint.glht(tmp)
par(old.oma)
I have not been able to get it to work. I would greatly appreciate some
suggestion.
Thanks .../Murli
Works alright for me:
> summarise(baseball,duration = max(year) - min(year),nteams =
> length(unique(team)))
duration nteams
1 136132
> ddply(baseball, "id", summarise, duration = max(year) - min(year), nteams
> = length(unique(team)))
id duration nteams
1aaronha01
Hi,
it works for me with plyr version 0.1.9. Try upgrading to the latest
version, or post your sessionInfo()
HTH,
baptiste
2009/9/25 Veerappa Chetty :
> Hi,I am using the amazing package 'plyr". I have one problem. I would
> appreciate help to fix the following error: Thanks.
> ___
Try this:
DF <- data.frame(A = c('11_12', '22_23', '33_34'),
B = sample(3))
#1) Using strsplit
transform(DF, C = sapply(strsplit(as.character(DF$A), "_"), '[', 1))
#2) Using substr
transform(DF, C = substr(DF$A, 1, 2))
#3) Using regex
transform(DF, C = gsub("_.*", "", DF$A))
Hi,I am using the amazing package 'plyr". I have one problem. I would
appreciate help to fix the following error: Thanks.
__
> library(plyr)
> data(baseball)
> summarise(baseball,
+ duration = max(year) - min(year),
+ nteams = length(unique(team)))
Error: could not find
Once you have reduced it to a data frame as already discussed, its
just a ggplot2 problem so you can take it to the ggplot2 group:
http://groups.google.com/group/ggplot2
On Fri, Sep 25, 2009 at 9:58 AM, Bogaso wrote:
>
> Thanks Gabor for your input. However I know there is option in "zoo" to plot
Currently as the first column in a data frame I have string values in the
format xx_yy - I want to create a new column with just the substring xx (for
each row in turn). Three possible ways to do this might be (1) split the
string by '_' using strsplit and paste the first of the resulting varia
Thanks Gabor for your input. However I know there is option in "zoo" to plot
multiple time series. However I want to go with ggplot2 because it looks
better. If anyone point me where is the problem in my ggplot2 code, I would
be truly grateful.
Thanks,
Gabor Grothendieck wrote:
>
> First get
First get the correct representation which here would be a multivariate
zoo series with 51 time points and 6 components series and then plot it
using zoo's plot function:
z <- zoo(matrix(dat, 51), time(dat2))
# all in one panel
plot(z, pch = letters[1:6], screen = 1, type = "b", col = 1:6)
# or
Let me be more specific. My goal is to plot following multiple TS, using
ggplot2
dat1 <- zooreg(matrix(rnorm(306), 51), as.yearmon(as.Date("2000-01-01")),
frequency=12)
colnames(dat1) <- letters[1:6]
dat1
Still I can not get what is problem in my ggplot2 codes. Please give some
idea.
Best,
Bo
Thanks for this reply. Here my goal is to plot multiple time series in the
same plotting window. Here y variable has 306 elements, however each value
is associated with factor which is represented by "vv" variable.
I want to plot total 6 time series, for example 1st 51 values of y,
represented b
Yeah, I also would like to know what synergy can I get from combining
the power of R and SAS...
Maybe there are something that's particularly strong in R and
someother that's particularly strong in SAS?
Thanks!
On Thu, Sep 24, 2009 at 10:26 PM, Indrajit Sengupta
wrote:
> Here's a good website o
You are mixing data from two datasets with different lengths. Your x
variable has 51 elements, while the y variable has 306 elements? What
did you expect to happen with that?
Use only one dataset within a geom(). Otherwise you are likely the get
in troubles.
HTH,
Thierry
---
It looks like you are trying to mimic the SAS data step. In R you can
vectorise this.
a_data <- read.table("D:/SNP/copy.sas", header=T, sep="\t")
a_data$stat <- with(a_data, ifelse(truck < 0, 0, ifelse(cars > 100, 0,
cars)))
a_data$i <- seq_len(nrow(a_data))
outTable <- a_data[, c("i", "stat", "t
Thank you so much, everyone!
Very helpful!
Dimitri
On Thu, Sep 24, 2009 at 7:46 PM, Moshe Olshansky wrote:
> test[which(test[,"total"] %in% needed),]
>
> --- On Fri, 25/9/09, Dimitri Liakhovitski wrote:
>
>> From: Dimitri Liakhovitski
>> Subject: [R] keeping all rows with the same values, and n
Thank you Paul, I was convinced I tried this option but I obviously didn't!
In ?packGrob, the user is warned that packing grobs can be slow. In
order to quantify this, I made the following comparison of 3
functions,
- table1 uses frameGrob and packGrob
- table2 uses frameGrob but calculates the s
You could also try Rserve
http://www.rforge.net/Rserve/
-cj
vikrant S wrote:
I want to call R functions from Java. I read a couple of forums that said to
install package rJava in R.
However I am not able to install rJava package in linux Ubuntu.I tried with
two commands.
One is
install.packag
On Sep 25, 2009, at 6:29 AM, Ashta wrote:
Dear R-users,
Suppose I have the following sample of data,
0 1 2 4 3
1 2 1 3 1
1 3 3 4 1
0 1 2 1 2
1 4 1 4 2
1 2 2 1 1
The first variable is the response variable where 0 is defective and 1
normal. The other four f
Thank you very much for help. Here is my values of Sale Date
>sample
test[1:100, 76]
11989-08-01
21900-01-01
32003-11-18
42003-05-30
52005-08-18
61990-04-01
71989-01-01
81900-01-01
91996-03-12
10 1900-01-01
11
Tobias Ruff wrote:
Hello everybody out there using R,
How can I import data with a numeric header from a .csv-file?
My file example.csv has the following content (a duplicate measurement of
potentials for three different currents):
1; 2; 6
1.0; 2.1; 5.9
1.1; 2.0; 6.0
I try to import the data b
Try this:
measurement <- read.table("example.csv", sep = ";",
header = TRUE, check.names = FALSE)
plot(mean(measurement), names(measurement), xaxt = 'n')
axis(1, names(measurement))
On Fri, Sep 25, 2009 at 3:53 AM, Tobias Ruff wrote:
> Hello everybody out
I am using if else and loop to sortout the data set that is the values
less than o or more than 100 will be chosen.I could not get outTable
with loop.
Please help me to correct the code:
I USED:
# Read
a_data <- read.table("D:/SNP/copy.sas", header=T, sep="\t")
tr <- a_data$truck
ca <- a_data
my data :
library(doBy)
lines<-"lo ptcl5 ptcl99 variable
430. 8787a
430 3422343 m
430. 89mr
4314564774a
431 299 2777m
4319996 mr
432
Hi,
Thank you.
It was that.
Julien.
Tal Galili wrote:
>
> check for missing values.
> Tal
>
>
>
> On Wed, Sep 23, 2009 at 3:27 PM, pompon wrote:
>
>>
>> Hi,
>>
>> I am performing a repeated measures 2-way ANOVA to assess the influence
>> of
>> plant and leaf on aphid fecundity. Fecund
I want to call R functions from Java. I read a couple of forums that said to
install package rJava in R.
However I am not able to install rJava package in linux Ubuntu.I tried with
two commands.
One is
install.packages("rJava")
and another I downloaded the rJava_0.7-0.tar.gz file from R site.
and
Hello everybody out there using R,
How can I import data with a numeric header from a .csv-file?
My file example.csv has the following content (a duplicate measurement of
potentials for three different currents):
1; 2; 6
1.0; 2.1; 5.9
1.1; 2.0; 6.0
I try to import the data by using:
>measurement
Hi, I have following codes :
library(zoo); library(ggplot2); library(plyr)
dat <- rnorm(306); vv <- letters[1:6]; dat1 <- data.frame(dat, vv)
dat2 = zooreg(rnorm(51), as.yearmon(as.Date("2000-01-01")), frequency=12)
ggplot(dat1) +
geom_line(aes(y=dat, x=index(dat2),
Create the series as zoo series from the data, and then merge them and
fill in NAs with interpolated values using na.approx. Finally use
window to pick off the times that were in z1 and plot. See the three
vignettes that come with zoo and for time and dates see the article in
R News 4/1 and its r
Dear R users,
My set-up: OS=Windows XP, R-2.9.2, Rtools210
I faced the follwing problem with the package compilation: There is no
"/inst" or "/etc" subdirectory in the package-zip-file. And the content of
the "/etc" subdirectory is lost, too. I tried a simplified "test" package.
The "test" packag
Dear R-users,
Suppose I have the following sample of data,
0 1 2 4 3
1 2 1 3 1
1 3 3 4 1
0 1 2 1 2
1 4 1 4 2
1 2 2 1 1
The first variable is the response variable where 0 is defective and 1
normal. The other four factors( x1,x2,x3,x4) that influence the
Hello,
Could you please tell me wether there is any function in R that tell me how
many subgroup in one variable I have? So for example if my data are
x <- c(rnorm(50,50,3),rgamma(50,2,1),runif(50,0,1))
I want to know how many group I have?
Many thank in advance,
Samuel
--- On Thu, 9/17/09, S
Hi,
You need to install the headers/libs for readline. Probably using your
package manager, look for something like readline-devel.
cheers,
Paul
Yuan Zhidong wrote:
Dear Sir,
When I install R on SUSE Linux Enterprise Server 10 (ia64)
(Linux a450 2.6.16.21-0.8-default #1 SMP Mon Jul 3 18:25:3
Thank you so much for those helps. However I need little more help. In the
site
"http://www.rateinflation.com/consumer-price-index/usa-historical-cpi.php";
if I scroll below then there is an option "Historical CPI Index For USA"
Next if I click on "Get Data" then another table pops-up, however wit
This is to announce that we plan to release R version 2.10.0 on Monday,
October 26, 2009.
Release procedures start today. The detailed schedule can
be found on http://developer.r-project.org
The source tarballs will be made available daily (barring build
troubles), starting September 28, and the
hm567 wrote:
>
> I am unsure about spar being the smoothness parameter, about where to put
> the standard errors of the points, and about the return of the
> smooth.spline function:
> Smoothing Parameter spar= 0.5 lambda= 0.006833112
>
> best regards,
>
Basically, the implementation base
Folks,
I have some weekly dataseries that I convert to monthly xts (with
yearmon indices), and obtain the two following extracts:
> str(sig)
An 'xts' object from Apr 1998 to Sep 1998 containing:
Data: num [1:6, 1] 0.0083 0.2799 -0.2524 -0.0119 0.18 ...
- attr(*, "dimnames")=List of 2
..$ :
2009/9/25 Felix Andrews :
> Sorry, doubleYScale is not appropriate, since you specifically want a
> common y scale.
>
> I think Baptiste was suggesting to use layer(), rather than
> as.layer():
Truth be told, I wasn't quite sure what the initial request meant. I
took it quite literally, as "superi
OK, it makes sense. Let's try that.
Best,
baptiste
2009/9/25 Paul Murrell :
> Hi
>
>
> baptiste.auguie wrote:
>>
>> (Sorry about the double post earlier, googlemail is having hiccups today)
>>
>> 2009/9/24 Romain Francois :
>>>
>>> Why just grid ? why not a list for all kind of graphics ?
>>
>>
both the following will probably do the trick.
?subset
?"["
Basically on the second one, you want to come down to something that
looks like
x[L]
where x is a matrix/vector, and L is a logical vector that has the
same dimension as x, but is TRUE on the values of x that you want to
select.
for i
86 matches
Mail list logo