Displaying 20 results from an estimated 500 matches similar to: "data frame"
2006 Jul 04
1
Problems when computing the 1rst derivative of mixtures of densities
Hi everybody,
I am currently working on mixtures of two densities ( f(xi,teta)=
(1-teta)*f1(xi) + teta*f2(xi) ),
particularly on the behavior of the variance for teta=0 (so sample only
comes from the first distribution).
To determine the maximum likelihood estimator I use the Newton-Rapdon
Iteration. But when
computing the first derivative I get a none linear function (with several
asymptotes)
2011 Mar 29
3
Reversing order of vector
Dear R helpers
Suppose I have a vector as
vect1 = as.character(c("ABC", "XYZ", "LMN", "DEF"))
> vect1
[1] "ABC" "XYZ" "LMN" "DEF"
I want to reverse the order of this vector as
vect2 = c("DEF", "LMN", "XYZ", "ABC")
Kindly guide
Regards
Vincy
[[alternative HTML
2008 Nov 18
4
How do I generate multiple (similar) objects within R?
Hi,
I wonder if anyone knows how to generate a list of objects, e.g. ten
vectors with names: vect1, vect2, ... , vect10.
My own idea was to use something like:
for (i in 1:10)
print(paste("vect", i,"<-NULL",sep=""))
but the result is:
"vect1<-NULL"
...
"vect10<-NULL"
and not
vect1<-NULL
...
vect10<-NULL
as I would
2009 Aug 24
2
Generate random sample interval
Hi, R users,
I have a problem about how to generate random sample interval from a duration.
For example, during a time duration 0-70s, I want to generate a sample which last 10s.
the sample could be 0-10 or 30-40s or 25-35s etc
How could I do it in R`??
Thanks a lot.
Tammy
_________________________________________________________________
Share your memories online with anyone you want.
2007 Nov 28
2
alternatives to traditional least squares method in linear regression ?
Dear list,
I have encountered a special case for searching a linear regression
where I'm not satisfied with the results obtained using the traditional
least squares method (sometimes called OLS) for estimating/optimizing
the residues to the regression line (see code below). Basically, a
group of my x-y data are a bit off the diagonal line (in my case the
diagonal represents the ideal or
2008 Sep 03
2
optimizing speed of calculation (recursive product)
Dear list,
I'm wondering how to optimize functions/processes like the one shown
below (which simplifies something we're trying to do with very large
datasets).
In many cases I've noticed that using apply, sapply etc can help
speeding up processes, but in this case I don't see how I could do so.
a <- runif(10000000,0.5,1.6)
C <- 2
M <- 10000000
system.time( for (i in
2009 Sep 24
1
how to make a function recognize the name of an object/vector given as argument
Dear guRus,
I'd like to learn how to make a function recognize the name of an
object/vector given as argument
If I have :
testFun <- function(x,y) plot(x,y, main=paste("plot
of",names(x),"and",names(y)) ) # this just a simple example ...
a1 <- 5:8
b1 <- 9:6
testFun(a1,b1)
# Returns the plot, but not the names of the objects/vectors given as
arguments,
# but
2011 May 31
1
how to define PKG_CONFIG_PATH ?
Dear List,
as I'm trying to install R and Rgraphwiz on a Fedora Linux, I have a problem with the environement variable "PKG_CONFIG_PATH". The library "libgvc" is not getting recognized / found, although a recent version libgvc is on the system and can be seen via /usr/lib64. I've tried to edit the paths described in /etc/ldpaths but without any success. Any hints how
2009 Mar 10
1
require() is not giving TRUE / FALSE statements ?
Dear list,
?require says :
"... |require| is designed for use inside other functions; it returns
|FALSE| and gives a warning (rather than an error as |library()| does by
default) if the package does not exist ..."
However when I run the following code I don't get any TRUE / FALSE
statements (but the warning only).
Since I want to test from inside of a function if a given package
2007 Oct 04
1
Problem with .libPaths & Rterm.exe (under Vista)
Dear list,
I?m using R embedded in another program (coded in tcl/tk) under Windows
Vista. In this context I don?t launch Rgui.exe but rather Rtem.exe.
Now I have a problem finding libraries not specifically installed as
administrator (and which are not in the path ?program files? but in
Contacts\Documents of the current user). To be precise, the user
launching my tcl/tk program can?t find
2007 Jan 31
1
problem with compilation of R on Solaris 10 in x86
Dear List,
we're trying to install R on Solaris10 on a x86 (amd64).
During the installation we pass successfully the ./configure but we get
an error through the built-in function "_isnan" which we see existing in
/lib
When passing the command "make" we get :
gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2
-I../../src/extra/pcre -I. -I../../src/include
2007 Jan 03
2
accessing arrays
hi all. how can i adress a array directly. for example i wanna give array 1
other labels than array 2. How can I overcome this problem?
...this doesn't work
tab <- array(1:8, c(2, 2, 2))
dimnames(tab[,,1]) <- list(c("No","Yes"), c("No","Yes"),c("ARRAY1"))
dimnames(tab[,,2]) <- list(c("big","small"),
2009 Feb 16
1
Don't find a package !
Hi,
Please could somebody has any information about the following package:
IlluminaGUI, published here:
http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btm101v1
The link given in the article is dead and authors doesn't reply !
Is there someone who uses it ?
Thank you very much for help
--
View this message in context:
2009 Apr 14
1
using Sweave, how to save a plot in a given size
Hi,
I'm trying to realise a repport with R and Latex (TeXnicCenter and Miktex for Windows) using Sweave().
I'd like to save my plots in a given size. How can I do that ? The code is :
\SweaveOpts{prefix.string = figs/plot, eps = FALSE, pdf = TRUE}
<<partI, echo=FALSE ,fig=TRUE, include=FALSE>>=
plotFunction()
@
\includepdf[pages=-]{figs/plot-partI}
When I use
2010 Dec 21
2
replace values of a table !!!
Dear all,
Dear all,
I am a relatively new user.
I have an ascii file with 550 rows and 400 columns. The file contain values ranging from 1 to 2000 and some values with -9999.
I want to generate a new file where the -9999 values are replaced with 0 values, the other values with the 1.0 value.
What should I do,
Thanks
Taiseer
2007 Feb 08
2
path for source()
hello,
i have a couple of .R files distributed about my file system. i commonly source() these from other files, but i have to include the full file path. this is not always convenient if you move files around. is there a way of setting the search path for source()?
thanks a lot!
cheers,
andrew.
--
Andrew B. Collier
Space Physics Group
Hermanus Magnetic Observatory
Honorary Research Fellow
2007 Mar 06
2
Package RODBC
I have some questions about the RODBC package.
library(RODBC) # required for those who want to repeat these lines
1st, I noticed that the following sequence does not work:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlFetch(channel, name1) # bang!
2010 Nov 15
1
Sweave: Conditional code chunks?
I have a code junk that produces a figure. In my special case,
however, data does not always exist. In cases where data exists, the
code chunk is of course trival (case #1), however, what do I do for
case # 2 where the data does not exist?
I can obviously prevent the code from being executed by checking the
existence of the object x, but on the Sweave level I have a static
figure chunk. Here an
2011 Mar 15
4
run a slef-written function
How could one get started with a self-written function?
I have a function written in .txt format, but can not find the way to import
it to the R space.
Would be very appreciated for help.
--
View this message in context: http://r.789695.n4.nabble.com/run-a-slef-written-function-tp3356537p3356537.html
Sent from the R help mailing list archive at Nabble.com.
2009 Oct 26
3
Sandard deviation calculation
Dear all
I am trying to learn R
I was trying to calculate standard deviation
here are the commands and outputs in R
> sd(Ht_cm[type=='SD'])[1] 3.283605> sd(Ht_cm[from_treeline=='above'])[1] 16.83289> sd(Ht_cm[type=='SD'][from_treeline=='above'])[1] NA>
the problem is that, i could not understand why the third command could not give any result.