Displaying 20 results from an estimated 20000 matches similar to: "Documentation for library() and how to specify missing arguments"
2010 Jul 27
3
Checking package licences including dependencies?
I only recently discovered options("available_packages_filters" =
list(add = TRUE, "license/FOSS")) [cf. help("available.packages",
package="utils") in R 2.10.0 or later] which goes nicely with my
options("checkPackageLicense" = TRUE) [new in R 2.11].
But now I want to purge my library of packages I would not have
installed had I known about
2009 Jul 02
5
save the result into a word file
Hi, everyone:
I forget on how to save a result from R as a word document. For
example, if I run the linear regression and want to save the result:
summary(lm(y~x)
in a word file. So I can show it later to my clients. Any idea on
how to do this?
Thanks a lot,
Suyan
2009 Jul 02
2
How to use current value of variable in function definition?
Must be the heat or something but I can't get my brain into gear and
figure out how to get something like
if (1) { c <- 1; foo <- function () print(c); }
c <- 2
foo()
to print 1, not 2. (The real life example is a little more complex, but
you get the idea. I don't want the variable c in the function
definition, I want its value at that time.)
The only thing I have been
2009 Jun 11
2
How to order an data.table by values of an column?
Hello!
Can you help me? How to order an data.table by values of an column?
Per example:
Table no initial
Categ Perc
468 31.52
351 27.52
0 0.77
234 22.55
117 15.99
table final
Categ Perc
0 0.77
117 15.99
234 22.55
351 27.52
468 31.52
Lesandro
Veja quais são os assuntos do momento no Yahoo! +Buscados
[[alternative HTML version deleted]]
2009 Jun 04
3
Fast way of finding top-n values of a long vector
If x is a (long) vector and n << length(x), what is a fast way of
finding the top-n values of x?
Some suggestions (calculating the ratio of the two top values):
library("rbenchmark")
set.seed(1); x <- runif(1e6, max=1e7); x[1] <- NA;
benchmark(
replications=20,
columns=c("test","elapsed"),
order="elapsed"
, sort = {a<-sort(x,
2011 Mar 14
4
Serial Date
Hello R Help,
I'm working in a project with a software that register date and time data in serial time format. This format is used by excel, for exemple. In this format, 40597.3911423958 is 2011/2/23 09:23:15. First part is number os days since 1900/1/1, and second part is a fraction of a day.
I need to make this transformation in R, and use it to make some algebrian operations. I found that
2009 Jun 17
3
tiff() woes
Hello all,
a friend has a problem with tiff() which I was unable to help about. I
searched the error messages to no avail. When he tries:
tiff(filename = "FedeWhyDoesntThisBloodyWork.tif", width = 5, height =
5, units = "cm", bg = "white", res = 1200)
Error in tiff(filename = "FedeWhyDoesntThisBloodyWork.tif", width =
5, :
unable to start device
2010 Jul 26
3
Cluster analysis
Hi all,
I have no idea if this question is to easy to be answered, but I?m starting
with R. So, here we go.
I have a large dataset with a lot of steps a judicial case. A sample is
attached.
I?d like to do a cluster analysis to try to understand with one is the most
usual path followed by this legal cases.
After that, I?d like to plot a cluster tree.
In the attached sample, the column:
-
2011 Mar 14
7
creating character vector
Is there a way to convince R to create a character vector without using the quotes?
This works
ex1 <- c("first","second")
but when I try this it doesn't
ext <- as.character(c(first,second))
it complains. I have many variables to put into character vectors so dispensing with the quotes would be useful.
Thanks
Jim
===============================
Dr. Jim Maas
2011 Aug 22
3
Ignoring loadNamespace errors when loading a file
On a Unix machine I ran caret::rfe using the multicore package, and I
saved the resulting object using save(lm2, file = "lm2.RData").
[Reproducible example below.]
When I try to load("lm2.RData") on my Windows laptop, I get
Error in loadNamespace(name) : there is no package called 'multicore'
I completely understand the error and I would like to ignore it and
2010 Jul 22
4
SQL/R
Dear R users,
I want to aggregate data in the following way:
###
X <- data.frame(u = c("T1","T1","T1","T2"), v=c("a","a","b","a"))
X
library(sqldf)
sqlOut <- sqldf("select count(distinct(v)) from X group by u")
sqlOut
###
Now I want to get the same result without using SQL. How can I achieve
that ?
2010 Jul 01
1
How best to set library search path so user libraries come first
I want my local libraries to have priority over the system installed
ones, which, as far as I can make out from help(".libPaths"), means they
have to come first in that list (it doesn't actually_say_ so, but that
seems to be the idea).
We have R_LIBS_USER which looks made for specifying where I keep my own
libraries. Unfortunately it comes last in .libPaths() [which appears to
2004 Feb 03
3
R: plotting multiple functions
Hi all
Another simple question.
I would like to plot three graphs one the same plot with different
colours. Say red, blue and black. Here are the functions.
r1<-1+5*cos(2*pi*seq(1:100)/20)+rnorm(100)
r2<-1+7*sin(2*pi*seq(1:100)/20)+rnorm(100)
r3<-1+7*sin(2*pi*seq(1:100)/20)+5*cos(2*pi*seq(1:100)/20)+rnorm(100)
Regards
Allan
2010 Aug 06
1
[OT] R on Atlas library
Dear List,
I am aware this is slightly off-topic, but I am sure there are people who already had the problem and who perhaps solved it.
I am running long-lasting model fits using constrOptim command. At work
there is a linux computer (Quad Core, debian) on which I already have
compiled R and Atlas, in the hope that things will go faster on that
machine.
Atlas offers the possibility to be
2011 Mar 16
2
how do we read netcdf / hdf files in R?
Dear R Users,
How do we read netcdf / hdf format files in R ?
Also, can we convert netcdf to hdf format in R?
Great Thanks,
Best Regards,
Yogesh
[[alternative HTML version deleted]]
2011 Mar 18
2
Need help with error
Hi R users,
I am getting the following error when using the splsda function in R
v2.12.1:
"Error in switch(classifier, logistic = { : EXPR must be a length 1
vector"
What does this mean and how do I fix this?
Thank you in advance!
Best,
Savi
2011 Mar 15
1
install.packages barfs on dependencies= argument
I'm sure I used to be able to do
my.dependencies<- c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")
install.packages("animation", lib = Sys.getenv("R_LIBS_USER"), dependecies = my.dependencies)
but now I get
Error in download.file(url, destfile, method, mode = "wb", ...) :
unused argument(s)
2010 Jun 04
1
Reading newlines with read.table?
I have a text file that is UTF-16LE encoded with CRLF line endings and
'@' as field separators that I want to read in R on a Linux system.
Which would be fine as
read.table("foo.txt", file.encoding = "UTF-16LE", sep = "@", ...)
*except* that the data may contain the LF character which R treats as
end-of-line and then barfs that there are too few elements
2010 Jul 16
2
Recommended way of requiring packages of a certain version?
What is the recommended way of requiring a certain version when loading
a package (or, indeed, from R itself)?
Perl has the
require module version
use module version
require version
use version
constructs which is kind of what I am looking for (especially 'use'
which is evaluated at compile time), but R seems to have lost the
version= argument to require().
The best I have been able
2009 Jun 12
1
Changing CRAN package compile option defaults?
Is there an easy way to override the compile options when installing
packages from CRAN on Unix-style systems? I tried setting CFLAGS,
CXXFLAGS, and FFLAGS but they are not picked up.
For example (with a random package and adding -mtune only to try to get
rid of the default)
export CFLAGS="-march=native -mtune=native"
export CXXFLAGS="-march=native -mtune=native"
R CMD