in order to return more multiple variables, you can put them in a list
and then return this list.
e.g.
#Function A
boot<-function(a,b,c){
mean_boot<-(a+b)/2
var_boot<-c
list(mean_boot = mean_boot, var_boot = var_boot)
}
out <- boot(1,2,3)
out
$mean_boot
[1] 1.5
$var_boot
[1] 3
On Fri, Aug 1
Thanks,
Bjørn-Helge Mevik wrote:
"[Ricardo Rodriguez] Your XEN ICT Team" writes:
John Kane wrote:
No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/.
Any similar option for Mac OS X?
I guess you can use Emacs on Mac OS X.
I've downloaded and installed Aquamacs Emac
Hi Stephen,
I have read .mdb files using RODBC package.
Try give a look on it.
bests
milton
On Fri, Aug 14, 2009 at 7:55 PM, stephen sefick wrote:
> > library(Hmisc)
> > # Read all tables in the Microsoft Access database blabla.mdb
> > # perhaps better change to Locale in which the .mdb f
I know I am going to catch alot of comments for this question but I am really
stuck. If there is some written documentation that I have missed please
redirect me.
I want to build 'R' from source on a Windows Platform. The main reasons are
that I want to check out a debugging some existing packa
> library(Hmisc)
> # Read all tables in the Microsoft Access database blabla.mdb
> # perhaps better change to Locale in which the .mdb file was
> # generated to avoid that accented table column names are
> # getting lost.file first
> Sys.setenv(PATH=paste(Sys.getenv('PATH'),'/sw/bin',sep=':')
On Fri, Aug 14, 2009 at 9:11 PM, Kate
Zinszer wrote:
> I'm hoping that someone could guide me in how to extract data from
> shapefiles. I want to extract data from a shapefile (classed as
> "SpatialPolygonsDataFrame") and more specifically, the data is contained
> within the slot called "coords
Hi, R users,
Does anyone know whether there are any Discrete Choice Modeling modules
for R? Any books or websites discussing this?
Thanks
Harry
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
Hi listers,
I am working on a simulation... But I am having some troubles...
Suppose I have a function A which produces two results (mean and
variance)...
Then I would like to simulate this function A with a function B many times
using the results from function A
For example:
#Function A
boot<-fu
How can I understand if a distribution is bimodal? The quantiles of
desired probablities and also cumulative probablities in desired data
points are provided.
--
Free e-mail accounts at http://zworg.com
__
R-help@r-project.org mailing list
https://stat.
This is just one suggestion for a solution, and I think there may be much
more elegant ones out there. However, this should work.
1. Reshape your data in long format
2. Merge the table that holds the values you want to multiply your data with
with your reshaped dataset (this may require transforma
Hello friends,
in SAS there is the 'libname' source. You associate a way.. ex: ab .. "C:\My
Paste\Works" and when u do
data ab.example;
(...)
run;
you are saving the archive "example" in a SAS format, and you can see
C:\My Paste\Works\example "growing" ("example"'s size:200MB... refresh..
500
Dear Deepayan,
I see your point. I must admit that I was considering only formula's as x
argument for the trellis plots. What I would really like to have in your
example, would be
barchart.matrix <- function (x, data = NULL, ...) {
foo <- barchart(as.table(x), data, ...)
foo$call <- match.c
Windows XP
R2.8.1
I am running an balanced aov, in which Time has 4 levels, Group has 2
levels:
fit2<-aov(Post ~ as.factor(Time)
+as.factor(Group)+as.factor(Group*Time)+Error(SS), alldata)
I would like to get a p value for each level of time, each level of
Group and each level of Group*Time. How
Thanks, for lwd. I could not find rgl 0.85. The latest one I saw was 0.84. Can
you tell me where I can download it from?
Also, is there a curve3d? I need to join two points in 3d smoothly.
Thanks ../Murli
-Original Message-
From: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Sent: Thu
I'm hoping that someone could guide me in how to extract data from shapefiles.
I want to extract data from a shapefile (classed as "SpatialPolygonsDataFrame")
and more specifically, the data is contained within the slot called "coords"
from the class "polygons" within this file and despite my b
?solve
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Moreno Mancosu
> Sent: Friday, August 14, 2009 1:23 AM
You could try setting options(error=function() NULL). This should cause R in
batch mode to continue running after an error (the same way it does in
interactive mode.)
-- Tony Plate
Nir Shachaf wrote:
Hi All,
I am running an Rscript with a bunch of algorithms that are UNSTABLE
under some par
Here is the solution for a shading between two curves. [much thanks to W.D.)
attach(cars)
#put 2 curves on the graph
scatter.smooth(speed, dist+25,family = "gaussian",span =
.3,xlim=c(3,25),type='n',ylim=c(0,120))
par(new=T)
scatter.smooth(speed, dist-5,family = "gaussian",span =
.3,xlim=c(3,2
Once you have the long format of the dataset, you could just code a "bin"
variable and merge with this bin variable instead. Piece o' cake, ain't it?
Daniel
-
cuncta stricte discussurus
-
-Ursprüngliche Nachricht-
Von: r-help-boun...@r-pr
On Fri, Aug 14, 2009 at 11:04 AM, wrote:
>
> Dear Deepayan,
>
> First of all I'm sorry for resuming such an old thread, but I think I may
> have found an easy fix.
>
> Replacing in "xyplot.formula" (and similar internal functions for the other
> Trellis plots)
>
> foo$call <- sys.call(sys.pare
Thanks for everyones help and for the alternate ways of doing this. I am
always amazed at how many solutions this list comes up with for things I get
stuck on! It really helps us non-programmers learn R!
Aloha,
Tim
Tim Clark
Department of Zoology
University of Hawaii
--- On Fri, 8/14/09,
Jim,
Got it! Thanks for the explanation and the example. Always nice to learn new
tricks on R.
Aloha,
Tim
Tim Clark
Department of Zoology
University of Hawaii
--- On Fri, 8/14/09, jim holtman wrote:
> From: jim holtman
> Subject: Re: [R] Finding minimum of time subset
> To: "Tim Clark
Kind of to second Steve's concerns, I would suggest that you change the names
of your functions slightly (put xx. in front of them or some other prefix).
I remember a friend telling of a unix administrator that aliased the rm command
to actually run rm -i (rm deletes files, the -i makes it ask y
Thanks to you both for your responses.
3
I think these approaches will *nearly* do the trick, however, the problem is
that the reference/lookup table is based on 'bins' of latitude values, eg.>61,
60-56, 55-51, 50-46 etc. whereas the actual data (in my 720 x 360 data frame)
are not binned, e.g.
try something like this using 'list'
results.dataset <- list()
for(i in tracks)
{
a <- (subset(data, data$Id==i))
result.dataset[[i]] <- function(a, other.arguements)
### this function is the other iterative process, but its in another script
and is imported in so dont wo
This is just one suggestion for a solution, and I think there may be much
more elegant ones out there. However, this should work.
1. Reshape your data in long format
2. Merge the table that holds the values you want to multiply your data with
with your reshaped dataset (this may require transform
Hi again,
I found what I was doing wrong.
If you run:
> k <- rep(0,100)
> tmp <- length (k)
'tmp' now is an object of class 'integer'. I resolve the issue doing
> tmp <- as.numeric(length(k))
then the function
> tmp2 <- as.matrix.csr(0,tmp,tmp)
works properly
Thanks,
Jose
On Fri, Aug 14, 2009
You might want to look at 'findInterval'. This will give you back an
index based on the ranges you specify; e.g., the breaks in you table
that has the 'p' in it. Here is an example if your table had 100
values between -89.5 & 89.5 and was split evenly:
> x <- seq(-89.5, 89.5, length=50)
> x
[1]
Dear All,
I am trying to iterate an iterative process (i know R is not the best place
for so much looping but i have to so tough!) and store the resulting data
from each iteration to then be graphed. In simple form the script looks like
this
for(i in tracks)
{
a <- (subset(d
Dear Deepayan,
First of all I'm sorry for resuming such an old thread, but I think I may
have found an easy fix.
Replacing in "xyplot.formula" (and similar internal functions for the
other Trellis plots)
foo$call <- sys.call(sys.parent())
foo$call[[1]] <- quote(xyplot)
with
foo$c
sapply(mylist, '[', 1)
is equivalent to
sapply(mylist, function(x) x[1]) # select just the first element
"[" is an function that is called with a object and an index. Using
it the way I did in the email was a shorthand way of doing it. Here
is an example:
> x <- list(1,2,3)
> x[1]
[[1]]
[1]
Converting to "times" class we can use trunc.times to
truncate to 15 minutes and then use tapply to get the
indices, ix.
> library(chron)
> tc <- times(mytime)
> ix <- tapply(seq_along(tc), trunc(tc, "00:15:00"), head, 1)
> tc[ix]
[1] 12:00:00 12:15:05 12:30:01 12:45:01 13:00:00 13:15:02
Note tha
Dear R Users,
I have a data frame of 360 rows by 720 columns (259200 values). For each value
in this grid I am hoping to apply an equation to, to generate a new grid. One
of the parts of the equation (called 'p') relies on reading from a separate
reference table. This is Table 4 at:
http://ww
Here is the solution for shading under a curve
attach(cars) #example dataset
scatter.smooth(speed, dist,family = "gaussian",span = .3, xlim=c(3,25),
type='n') #plot a curve (smoothed line)
gg<-loess.smooth(speed,dist,family = "gaussian",span = .3) #put coordinates of
smoothed line into 'gg'
D
Jim,
That works great! However, would you please explain what the '[' and the 1 do
in the sapply function? I understand that you are cutting x by quarter, then
creating a list of x that is split based on those cuts. I just don't
understand what "[" means in this contex, or what the number on
thank you all- I will report back when I have tried on my computer at home.
On Fri, Aug 14, 2009 at 12:24 PM, Phil Spector wrote:
> Stephen -
> You can modify your path on the fly with Sys.setenv:
>
> Sys.setenv(PATH=paste(Sys.getenv('PATH'),'/sw/bin',sep=':'))
>
> should make executables instal
Stephen -
You can modify your path on the fly with Sys.setenv:
Sys.setenv(PATH=paste(Sys.getenv('PATH'),'/sw/bin',sep=':'))
should make executables installed in /sw/bin available to R.
- Phil Spector
Statistical
Try this also:
times <- as.POSIXlt(mytime, format = "%H:%M:%S")
subTimes <- times[times[['min']] %in% c(0,15,30,45)]
format(subTimes[!duplicated(format(subTimes, "%H:%M"))], "%H:%M:%S")
On Thu, Aug 13, 2009 at 5:10 PM, Tim Clark wrote:
> Dear List,
>
> I have a data frame of data taken every fe
You need a fundamental solution to your system problem but a quick fix
is to provide a symbolic link to the executable from a place that is in
your system path.
Frank
stephen sefick wrote:
Frank,
I have tried to use this package, but because I am using fink to
install packages the mdbtools b
The AT Access driver works reasonably well: it is described in the
current RODBC manual.
On Fri, 14 Aug 2009, Marc Schwartz wrote:
On Aug 14, 2009, at 10:29 AM, stephen sefick wrote:
I have a geodatabase and would like to import it into GRASS, but it is
in .mbf. I use mac and linux, and don
Frank,
I have tried to use this package, but because I am using fink to
install packages the mdbtools binary they are not accessible by the
function from within R. I checked this by just trying to call it with
the system function and R returned /bin/sh not found. I can access
the binary from the
The R Hmisc package interfaces these tools - see its mdb.get function.
Frank
Marc Schwartz wrote:
On Aug 14, 2009, at 10:29 AM, stephen sefick wrote:
I have a geodatabase and would like to import it into GRASS, but it is
in .mbf. I use mac and linux, and don't have access to access on the
m
Here is one way to do it:
> mytime<-c("12:00:00","12:00:05","12:15:05","12:15:06","12:20:00","12:30:01","12:45:01","13:00:00","13:15:02")
> # you might want a date on your data
> x <- as.POSIXct(mytime, format="%H:%M:%S")
> # create quarter hour intervals for the data range
> quarter <- seq(trunc(
On Aug 14, 2009, at 10:29 AM, stephen sefick wrote:
I have a geodatabase and would like to import it into GRASS, but it is
in .mbf. I use mac and linux, and don't have access to access on the
machines that I normally use. I do have access to access at school,
but I would like to find a way aro
Like this?
age<-as.integer(sample(rnorm(100, mean=30, sd=10), replace=T))
height<-as.integer(1+age*rnorm(100,mean=1,sd=0.2))
plot(age, height)
table(age,height)
or
freq=data.frame(table(age,height))
freq<-subset(freq,Freq>0)
freq
bests
milton
On Fri, Aug 14, 2009 at 5:02 AM, rajclinasia wrote
On 8/14/2009 10:31 AM, mahdiyeh wrote:
How I can generate a random sample from a mixed norml distribution?
(i.e. a mixed normal distribution in the form f(x)=.6*N(1,5)+.4*N(2,3)
in which N(A,B) is a normal distribution with mean A and variance B.)
Set up the means and SDs as constant vectors:
I have a geodatabase and would like to import it into GRASS, but it is
in .mbf. I use mac and linux, and don't have access to access on the
machines that I normally use. I do have access to access at school,
but I would like to find a way around this if possible. Any thoughts,
comments, or sugge
Hi there,
I'm having a problem when trying to create a large matrix (1,000,000 x
1,000,000) of the .csr type (package 'SparseM').
> k <- rep(0,100)
> tmp <- length(k)
> tmp2 <- as.matrix.csr(0,tmp,tmp)
Error in if (length(x) == nrow * ncol) x <- matrix(x, nrow, ncol) else { :
missing value w
How I can generate a random sample from a mixed norml distribution?
(i.e. a mixed normal distribution in the form f(x)=.6*N(1,5)+.4*N(2,3)
in which N(A,B) is a normal distribution with mean A and variance B.)
--
Free e-mail accounts at http://zworg.com
How I can create some sample data from a density in the form:
f(x)=sum(a(j)M(j)),
in which M(j) is the B-spline basis function. In fact my density
function is a linear combination of B-splines. (Is there any other way
than using the well-known and general uniform distribution method?)
--
Free e
John Sorkin wrote:
Windows XP
R 2.8.1
Is there any way to make a list of the from
1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n?
rep(1:n, each=3)
Greetings,
Christian
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
> rep(1:4, each=3)
[1] 1 1 1 2 2 2 3 3 3 4 4 4
On Fri, Aug 14, 2009 at 10:44 AM, John
Sorkin wrote:
> Windows XP
> R 2.8.1
>
> Is there any way to make a list of the from
> 1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n?
> Thanks
> John
>
> John David Sorkin M.D., Ph.D.
> Chief, Biostatistics and Inform
Hi,
On Aug 14, 2009, at 10:44 AM, John Sorkin wrote:
Windows XP
R 2.8.1
Is there any way to make a list of the from
1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n?
Like so?
R> rep(1:10, each=3)
[1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8
8 8 9
[26] 9 9 10 10 10
-st
Windows XP
R 2.8.1
Is there any way to make a list of the from
1,1,1,2,2,2,3,3,3,4,4,4, . . ., n,n,n?
Thanks
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Stre
Hi Matthew
You mentioned in mail direclty to me that this code worked
earlier in your morning. So that suggests that it is not
the code. But you should look carefully at the 2 lines
you ran (i.e. the ones below) and painstakingly check
that the user name and password are the same. It is
easy to o
On 8/14/2009 10:06 AM, Casimir wrote:
> Hi!
>
> I am quiet new with R and I have some problems to perform a posthoc test
> with an lme model.
> My model is the following:
>
>> lme1<-lme(eexp~meal+time, random=~1|id,na.action=na.omit)
>
> and then i try to get a post hoc test:
>
>> summary(glht(
Thanks, the pointer to the tokenizer helped.
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine
15032 Hunter Court, Westfield, IN 46074
(317) 490-5129 Work, & Mobile & VoiceMail
"The re
Hi!
I am quiet new with R and I have some problems to perform a posthoc test
with an lme model.
My model is the following:
>lme1<-lme(eexp~meal+time, random=~1|id,na.action=na.omit)
and then i try to get a post hoc test:
>summary(glht(lme1,linfct=mcp(meal="Tukey)))
but I get a warning message
If you really want to skip to the next line on an error without
checking, then wrap each line in 'try', or put blocks in a try:
try(...expr...)
try(...expr...)
try({
expr...
expr
expr
})
On Fri, Aug 14, 2009 at 8:51 AM, Nir Shachaf wrote:
> Thanks again for your
Thanks again for your reply, Thierry.
Packing several functions into another function
would again seem to create a nested structure
(only slightly smaller).
The simplest solution would be to use [R]'s parsing
or evaluation commands to skip to the next line
once a certain function returns an error
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Alex Roy
> Sent: Freitag, 14. August 2009 12:05
> To: r-help@r-project.org
> Subject: [R] Permutation test and R2 problem
>
> Hi,
>
>
> I have optimized the shrinkage parame
Graves, Gregory wrote:
I will attempt to distill my problem down to a simpler one, the solution of
which will hopefully lead me to the nirvana of complete understanding, i.e.,
inserting a polygon beneath an irregular line terminated by the x axis.
I 'know' that polygon will work -provided- I k
Thanks for bringing me to, arr[R] Inferno Patrick,
But I don't see how that solves my problem since
I am not using a loop or any control structure but
a construct of commands that follow each other.
If all fails I might end up rewriting everything into
a loop but right now I would hope for a comma
I will attempt to distill my problem down to a simpler one, the solution of
which will hopefully lead me to the nirvana of complete understanding, i.e.,
inserting a polygon beneath an irregular line terminated by the x axis.
I 'know' that polygon will work -provided- I knew the xy coordinates of
It is working for me. Are you using the latest version as in Version: 0.2-2?
Blackett, Matthew wrote:
>
> Hi
>
> I have been using RGoogleDocs successfully for some time now but something
> seems to have happened which is preventing me from accessing my data in
> google spreadsheets.
>
> I get
Hi List,
I used to access a Paradox database using RODBC, but since last week I
am not able anymore to fetch any table which has a name longer than 11
or 12 characters.
Here is the the pattern of my code, nothing spectacular:
library(RODBC)
channel2<-odbcDriverConnect('DSN=xxx')
#table names
It is quite obvious why you get the error message; check your data:
Error in wynik[, i] <- dodawanie(wzorzec, wzorzec1) :
number of items to replace is not a multiple of replacement length
No suitable frames for recover()
>
> i
[1] 1
> dodawanie(wzorzec, wzorzec1)
[1] 3 5 4 2 6 3
> str(wynik)
On Fri, Aug 14, 2009 at 1:43 PM, Mary Putt wrote:
> I'm not calling it a problem that the answer converges--i.e. that the
> algorithm is stable. but if you look at the example even though I've asked
> for 2000 or 200 tress, ntree=2000 or ntree=200, it still gives me 500 trees
> according to the
Graves, Gregory wrote:
I have a set of 52 weekly values, one is the desired high lake stage for
a week, and the other is the desired low lake stage for each week. It
looks like this:
...
I can plot out two nice curves using the following code, but I can't
figure out how to shade in the area lyin
Hi,
I have optimized the shrinkage parameter (GCV)for ridge and got my r2
value is 70% . to check the sensitivity of the result, I did permutation
test. I permuted the response vector and run for 1000 times and draw a
distribution. But now, I get r2 values highest 98% and some of them more
than
On Thu, Aug 13, 2009 at 11:11 PM, Mary Putt wrote:
Hi Mary,
> I would like to use a random Forest model to get an idea about which
> variables from a dataset may have some prognostic significance in a smallish
> study. The default for the number of trees seems to be 500. I tried changing
> the
Hi
I have been using RGoogleDocs successfully for some time now but something
seems to have happened which is preventing me from accessing my data in google
spreadsheets.
I get the message: "problems connecting to get the list of documents" when I
use getDocs, despite being logged in
e.g.
sh
Thanks! Now it works.
Roman
--
View this message in context:
http://www.nabble.com/metaplot-in-rmeta%3A-y-axis-disappears-tp24917401p24968707.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://s
Hi every one,
how to get frequency distributions for one variable across other variable.
ex: var1=age, var2=height i need frequency distribution of age across
height.
Thanks in Advance.
--
View this message in context:
http://www.nabble.com/cross-tabulation-for-frequency-distributions-tp2496853
It looks like a sound solution.
Thanks Vitalie.
Vitalie S. wrote:
Hi,
RG> Hi,
RG> I'm wondering if the following behaviour is normal:
RG> setClass('A', representation(number='numeric'), RG>
validity=function(object){ RG> if( obj...@number < -1 )
return("Invalid number")
Dear all,
Can anyone please explain this apparent problem with using pdIdent in
lme within a new function?
library(nlme)
y<-rnorm(30)
K<-matrix(rnorm(900),30,30)
df1<-data.frame(y=y,K=K,g=1)
df1$g<-as.factor(df1$g)
lme(fixed=y~1,random=list(g=pdIdent(~K-1)),data=df1,na.action=na.omit)
#Works
I use the function multinom to estimate a multiple logistic regression.
but I need one coefficient as generic. How can I do this? Or is it
possible to do this with an another function?
As example this is what I get:
Call:
multinom(formula = choice ~ time + costs, data = DATA)
Coefficie
On Thu, 13-Aug-2009 at 05:48PM -0700, caltechneurostudy wrote:
|>
|> Does anybody know if it's possible to have R send an email or execute an
|> additional line of code in case an error is generated from a running script?
|> I am running R on a cluster and would like to have it kill the job if R
Moshe Olshansky wrote:
Is your system of equations linear?
dear sir,
Yes, the system is linear. It can have this form:
a x + b y + c z = d
e x + f y + g z = h
But it can be more complex. I would like to calculate in R the solutions
under the form of equation of x,y and z.
Any idea?
Than
> "PJ" == Pitt, Joel
> on Thu, 13 Aug 2009 18:40:49 -0400 writes:
> As I said in my original email, I'm sure that many of
> you will doubt the wisdom of what I'm trying to do --
> and I certainly share some of your misgivings. I have
> misgivings too about the use of "
80 matches
Mail list logo