Hello, I do this in such way:
DATAX - matrix(seq(1,6,1),2,3)
DATAY - matrix (seq(1,4,1),2,2)
rownames(DATAX) - c(s1,s2)
rownames(DATAY) - c(s1,s2)
colnames (DATAX) - c(v1,v2,v3)
colnames (DATAY) - c(respone_1,response_2)
KAL - data.frame (N = rownames(DATAX))
KAL$Y - DATAY
KAL$X - DATAX
KAL$X
Dear HelpeRs,
I have a script where I save several thousands of graphics. These are
then used in Latex through Sweave. Unfortunately R crashes while making
these plots and Windows pops up some message that I run low on virtual
memory. I tried to save the plots using pdf(), windows() and
[EMAIL PROTECTED] wrote:
I want to get a lighter shade of a color...I have a lot of colored objects and
want each one printed as a foreground against a slightly lighter background.
I thought I could try something like changing the alpha channel by first
converting it to rgb.
But prior to
Jose Andres wrote:
Hi all,
I am trying to generate a distribution for the mean euclidean
distance between a group of n elements in a given surface (the
elements are randomly picked). Fo doing so I've written the
following code:
sampling- function(x,size) {
x-
[EMAIL PROTECTED] wrote:
hi,
i am a new member.
i am using R in finding correlation between two variables of unequal length.
when i use
cor(x,y,na.rm=T,use=complete)
where x has observations from 1928 to 2006 y has observations from 1950 to
2006. I used na.rm=T to use the
Dear Eleni,
But if every time you remove a variable you pass some test data (ie data
not used to train the model) and base the performance of the new, reduced
model on the error rate on the confusion matrix for the test data, then
this overfitting should not be an issue, right? (unless of
Hello!
Is it possible to set na.rm=TRUE in a global way? I'am constantly
forgeting on this when performing analyses. I agree that one should
be carefull with this when developing some code, but not necesarilly
so in data analysis.
Lep pozdrav / With regards,
Gregor Gorjanc
Murray,
How about creating an empty list and filling it during your loop:
mod - list()
for (i in 1:6) {
mod[[i]] - lm(y ~ poly(x,i))
print(summary(mod[[i]]))
}
All your models are than stored in one object and you can use lapply to
do something on them, like:
Gesmann, Markus [EMAIL PROTECTED] writes:
Murray,
How about creating an empty list and filling it during your loop:
mod - list()
for (i in 1:6) {
mod[[i]] - lm(y ~ poly(x,i))
print(summary(mod[[i]]))
}
All your models are than stored in one object and you can use
John Kane jrkrideau at yahoo.ca writes:
I have a dataset just imported from SPSS. It has any
number of 99's as missing data and it looks like the
next dataset will have custom missing codes. I have
abouat 120 variables and an N of 2000.
...
# define function
fn - function (x a) {
you
Question 2: Try saving the data as an SPSS portable file. I never had
trouble reading these in R.
Finn Sandø wrote:
When I try to import an spss sav file with read.spss() I am getting the
following error
'Error in read.spss(X:\\.sav) : error reading system-file header'
and the import
Like the error message tells you, cor does not have an argument na.rm.
use=complete already does what you want, namely casewise deletion of
missing values.
However, this will not work with vectors of unequal length (how is R to
determine which observations in x correspond to those in y?). What
Hi
try to post some reproducible example and maybe somebody can help you
more. You need to handle missing values one way or another. Either
you can supply a value for it or you can get rid of them. If you used
it in computation, the result will be NA. At least I think so.
HTH
Petr
On 31
I am trying to make a box plot and overlay it with a scatter plot from
another data.frame. I was able to successfully create the boxplot, but
when i tried using points(x~y...) the dots did not show up.
example code
aa-(300,300,300,300,600,600,600,600,900,900,900,900)
Hi
your example code is not reproducible.
On 1 Aug 2006 at 8:09, Lanre Okusanya wrote:
Date sent: Tue, 1 Aug 2006 08:09:38 -0400
From: Lanre Okusanya [EMAIL PROTECTED]
To: R-help@stat.math.ethz.ch
Subject:[R] Overlay Boxplot
my apologies about the initial bad sample code. Now assume I have
a-rnorm(6)
b-rep(c(10,20),each=3)
ab-data.frame(a,b)
and I wanted to overlay this points on the graph?
On 8/1/06, Petr Pikal [EMAIL PROTECTED] wrote:
Hi
your example code is not reproducible.
On 1 Aug 2006 at 8:09, Lanre
boxplot does not use the actual values of aa as x-value, but considers
aa as a factor having three levels.
Try
bxp - boxplot(bb~aa, data=nn)
bxp
to see what the boxplot actually is.
For your lines you should also use three levels.
aa2-c(1,1,1,1,2,2,2,2,3,3,3,3,3,3,3)
points(cc~aa2)
(after
Hi,
I followed the example in Writing R Extensions to create a shared
object in Windows, using the command
R CMD SHLIB X.cc X_main.cc
This was encountered:
../src/gnuwin32/MkRules:155: warning: overriding commands for target
'.c.d'
../src/gnuwin32/MkRules:143: warning: ignoring old commands
There is a global option setting for na.action. See ?na.action .
That does not completely address your question but might
help with lm, glm, etc.
You could define your own wrapper functions if you know ahead of time
which functions with na.rm= args you need. e.g.
my.max = function(..., na.rm =
This is very easy to do with ggplot:
# you need to get the development version from http://had.co.nz/ggplot:
install.packages(ggplot, dep=TRUE, repos=http://www.ggobi.org/r/;)
library(ggplot)
qplot(a, factor(b), type=c(boxplot,point))
qplot(factor(b), a, type=c(boxplot,point))
Regards,
Hadley
On 8/1/2006 9:06 AM, TAN Chong Hui wrote:
Hi,
I followed the example in Writing R Extensions to create a shared
object in Windows, using the command
R CMD SHLIB X.cc X_main.cc
This was encountered:
../src/gnuwin32/MkRules:155: warning: overriding commands for target
'.c.d'
Hi all,
I have a matrix with each column containing a large number of integers
(0 and above). in each column beyond a certain row (say row 120 in
column 1, row 134 in column 2, 142 in column 3...) there are only
0's. I want to find, for each column the row number of the last row
which contains
so in the following example (single column, but my real data has
multiple columns) how do I get the row number of the last row of x
beyond which there are 10 or more 0's (which in this case is row#100).
x - as.matrix(c(rep(seq(1:20),5),rep(0,20)))
max( which(x 0) )
JeeBee.
I'd like to convert a two-dimensional function f(x,y) to a matrix m,
so that m[x,y] = f [x,y]. How can I achieve this?
Thanks,
Lothar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
Dear friends,
Anybody knows how to fit the negative binomial distribution with MLE
using R or other software? I can't find the solution, any suggestions or
help would be greatly appreciated.
--
Kind Regards,
Zhi Jie,Zhang
[[alternative HTML version deleted]]
On Tue, 2006-08-01 at 07:03 -0700, Kartik Pappu wrote:
Hi all,
I have a matrix with each column containing a large number of integers
(0 and above). in each column beyond a certain row (say row 120 in
column 1, row 134 in column 2, 142 in column 3...) there are only
0's. I want to find,
On Tue, 01 Aug 2006 16:23:46 +0200, Lothar Schmid wrote:
I'd like to convert a two-dimensional function f(x,y) to a matrix m,
so that m[x,y] = f [x,y]. How can I achieve this?
Maybe this helps.
I create an empty matrix first, then apply f to the indices.
f - function(x, y) { 1000*x + y }
( m
JeeBee [EMAIL PROTECTED] writes:
On Tue, 01 Aug 2006 16:23:46 +0200, Lothar Schmid wrote:
I'd like to convert a two-dimensional function f(x,y) to a matrix m,
so that m[x,y] = f [x,y]. How can I achieve this?
Maybe this helps.
I create an empty matrix first, then apply f to the
This is a special case of
MASS::fitdistr
MASS::glm.nb
and the first will be easiest for you.
On Tue, 1 Aug 2006, zhijie zhang wrote:
Dear friends,
Anybody knows how to fit the negative binomial distribution with MLE
using R or other software? I can't find the solution, any suggestions or
Hi WizaRds,
I ran into trouble trying to install the debug package, which requires TCL/TK
support. It seems like the tcltk package is not installed on my system.
From: http://tolstoy.newcastle.edu.au/R/help/05/07/7993.html it seems that the
tcltk is bundled with the base R distribution.
I'm
John McHenry [EMAIL PROTECTED] writes:
Hi WizaRds,
I ran into trouble trying to install the debug package, which requires
TCL/TK support. It seems like the tcltk package is not installed on my system.
From: http://tolstoy.newcastle.edu.au/R/help/05/07/7993.html it seems that
the tcltk is
Hi, all,
I'm looking a utility for removing a directory from within R. Currently,
I'm using:
foo - function(...) {
mydir - tempdir()
dir.create(mydir, showWarnings = FALSE, recursive = TRUE)
on.exit(system(sprintf(rm -rf %s, mydir)))
## do some stuff in mydir
invisible()
}
Please ignore. I forgot ?unlink had a recursive argument.
Thanks.
--sundar
Sundar Dorai-Raj wrote:
Hi, all,
I'm looking a utility for removing a directory from within R. Currently,
I'm using:
foo - function(...) {
mydir - tempdir()
dir.create(mydir, showWarnings = FALSE,
Hello R-users and developers,
Once again, I'm asking for your help.
I've used identify to identify points in a scatter plot. However, I can't
apple in the boxplot.
I need to identify the outlier's id in the boxplot. Can anyone help me?
Thanks in advance,
Ana Patricia Martins
?unlink says that unlink() can remove directories (and has a 'recursive'
argument). 'unlink' is in the SEE ALSO section in ?file.remove.
-- Tony Plate
Sundar Dorai-Raj wrote:
Hi, all,
I'm looking a utility for removing a directory from within R. Currently,
I'm using:
foo -
Hi Peter,
Peter Dalgaard [EMAIL PROTECTED] wrote:
Did you build R yourself, and can you do library(tcltk) on R's command
line?
Yes, I built R myself. I couldn't find a debian package for R 2.3.1. The
latest available is 2.2.1.
library(tcltk)
Error in
Hello R-users and developers,
Once again, I'm asking for your help.
I've used identify to identify points in a scatter plot. However, I can't
apple in the boxplot.
I need to identify the outlier's id in the boxplot. Can anyone help me?
Thanks in advance,
Ana Patricia Martins
I have downloaded a DLL file. I want to look at the contents in the DLL file.
How can I do it in R?
Thanks,
QL
-
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch
Hello,
I am having difficulty with the ns function. I am
trying to use natural spline of a list of dates
in order to create a time series analysis where
date does not need to have a linear relationship
with the outcome.
Here is my code and the error message - I have
tried changing the class of
On 8/1/2006 1:01 PM, qian li wrote:
I have downloaded a DLL file. I want to look at the contents in the DLL file.
How can I do it in R?
As far as I know R has no tools to do that other than readBin, which
will just show you a bunch of meaningless bytes.
If you're on Windows, the MinGW
I imported an SPSS file with its data labels using
spss.get (Library(Hmisc).
Class = data.frame
I then updated some of the spss labels and added a
label to the object itself.
label (staff.allocation) - raw data from the spss
file
I then save it as an R object. When I load the object
for
Posting reply to the list as well:
On Tuesday 01 August 2006 07:02, Myers, Brent wrote:
Dylan,
We are working on the same problem. I'm shocked that I hadn't seen the
paper you posted and I am most grateful for that. I try to pay attention
to McBratney's work too!
Hi Brent, glad to hear
On Tue, 1 Aug 2006, qian li wrote:
I have downloaded a DLL file. I want to look at the contents in the DLL file.
How can I do it in R?
You need a disassembler such as VC++'s DUMPBIN, but looking at compiled
code you did not write is not an easy task. (Or objdump from the MinGW
toolset.)
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I want to get a lighter shade of a color...I have a lot of colored objects
and
want each one printed as a foreground against a slightly lighter
background.
I thought I could try something like changing the alpha channel by first
Hi
I'm trying to use the standalone library libRmath.
According to the documentation, I need to builld it in
src/nmath/standalone
But this directory does not exist in the R I installed.
What's the problem here, anyone?
Thanks!
Rgds
Chong Hui
[[alternative HTML version deleted]]
Hi
I'm trying to use R from Java.
There doesn't seem to be much documentation on this.
I installed JGR that has JRI and Rjava coming with it.
According to the short description at www.rosuda.org/JRI/,
there's supposed to be an examples directory in JRI.
I don't seem to be able to find that.
I
--- John Kane [EMAIL PROTECTED] wrote:
I imported an SPSS file with its data labels using
spss.get (Library(Hmisc).
Class = data.frame
I then updated some of the spss labels and added a
label to the object itself.
label (staff.allocation) - raw data from the spss
file
I then save
Hello All,
I am having trouble with installing the latest R on AIX 5.3, I can't
even configure.
checking how to get verbose linking output from /usr/vac/bin/
xlf_r... configure: WARNING: compilation failed
checking for Fortran libraries of /usr/vac/bin/xlf_r...
checking how to get
On Wed, 2006-08-02 at 03:44 +0800, TAN Chong Hui wrote:
Hi
I'm trying to use R from Java.
There doesn't seem to be much documentation on this.
I installed JGR that has JRI and Rjava coming with it.
According to the short description at www.rosuda.org/JRI/,
there's supposed to be an
Hi,
R is having the following weird behavior and I am not sure if that is a
feature or a bug:
I am working on the following 3D array:
bIm
, , 1
[,1]
[1,] TRUE
[2,] TRUE
[3,] TRUE
[4,] TRUE
[5,] TRUE
class(bIm)
[1] array
dim(bIm)
[1] 5 1 1
When I try to get the first 2D subarray, the
John Kane wrote:
--- John Kane [EMAIL PROTECTED] wrote:
I imported an SPSS file with its data labels using
spss.get (Library(Hmisc).
Class = data.frame
I then updated some of the spss labels and added a
label to the object itself.
label (staff.allocation) - raw data from the spss
file
On Tue, 1 Aug 2006, Swidan, Firas wrote:
Hi,
R is having the following weird behavior and I am not sure if that is a
feature or a bug:
It's a feature. And a very old FAQ (#7.5)
I am working on the following 3D array:
bIm
, , 1
[,1]
[1,] TRUE
[2,] TRUE
[3,] TRUE
[4,] TRUE
[5,]
On Wed, 2 Aug 2006, TAN Chong Hui wrote:
Hi
I'm trying to use the standalone library libRmath.
According to the documentation, I need to builld it in
src/nmath/standalone
But this directory does not exist in the R I installed.
What's the problem here, anyone?
Did you install a
Did you look in config.log for more information about the error?
It looks like you cannot even run your compiler.
(This is not really an R question, and off-topic for R-help: see the
posting guide.)
On Tue, 1 Aug 2006, kamil Marcinkowski wrote:
Hello All,
I am having trouble with
Hi,
Try this:
bIm -array(rep(TRUE,5),c(5,1,1))
bIm[,,1]
#[1] TRUE TRUE TRUE TRUE TRUE
bIm[,,1,drop=FALSE]
, , 1
[,1]
[1,] TRUE
[2,] TRUE
[3,] TRUE
[4,] TRUE
[5,] TRUE
See ?'[' for details on drop
drop: For matrices and arrays. If 'TRUE' the result is coerced to
the lowest
Hi folks!
What's a good way to replace NAs with a prior value in a time series
created with the fSeries package?
Thanks,
John
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
Hi,
I'm trying to find information about rsurv Simulating Survival data in
the IPred package, without luck this far. In the description of this
function we are asked to consult Hothorn et al. (2003) for the details.
This paper is not in the reference list. Should it be same authors (2004)?
Hello,
When plotting the results of a TukeyHSD multiple comparisons
procedure with an ANOVA (lm) object, an extra line appears
in the confidence intervals that contain 0. For example (this
is straight from the TukeyHSD helpfile):
summary(fm1 - aov(breaks ~ wool + tension, data = warpbreaks))
Hi all:
Newbies (and others!) may find useful the R Reference Card made available by
Tom Short and Rpad at http://www.rpad.org/Rpad/Rpad-refcard.pdf or through
the Contributed link on CRAN (where some other reference cards are also
linked). It categorizes and organizes a bunch of R's
Markus Gesmann writes:
Murray,
How about creating an empty list and filling it during your loop:
mod - list()
for (i in 1:6) {
mod[[i]] - lm(y ~ poly(x,i))
print(summary(mod[[i]]))
}
All your models are than stored in one object and you can use lapply
to
Hi
The problem is with the font information that R loads into memory. R
tries to load each unique font only once per session, but there was a
bug (or two) which meant that each time you create a new PDF (or
PostScript) device, R loaded another copy of the font information into
memory. So in
A simple way around this is to pass it as a data frame.
In the code below the only change we made was to change
the formula from y ~ poly(x, i) to y ~ . and pass poly(x,i)
in a data frame as argument 2 of lm:
# test data
set.seed(1)
x - 1:10
y - x^3 + rnorm(10)
# run same code except change the
Hi
Ana Patricia Martins wrote:
Hello R-users and developers,
Once again, I'm asking for your help.
I've used identify to identify points in a scatter plot. However, I can't
apple in the boxplot.
I need to identify the outlier's id in the boxplot. Can anyone help me?
Hi
Earl F. Glynn wrote:
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I want to get a lighter shade of a color...I have a lot of colored objects
and
want each one printed as a foreground against a slightly lighter
background.
I thought I could try something like changing
Hi
Gabor Grothendieck wrote:
Thanks. That's helpful.
I would be interested in the case where
1. one does not have a variable latticeplot, as per your example,
but just has the output of
xyplot(x ~ x | gl(2,1), layout = 1:2)
sitting on the screen, having been printed by a prior
Actually in thinking about this some more that still gets you
into a mess if you want to do prediction at anything other
than the original points.
On 8/1/06, Gabor Grothendieck [EMAIL PROTECTED] wrote:
A simple way around this is to pass it as a data frame.
In the code below the only change we
Hi there,
Wonder if someone who is R-savvy can help me with the following task (see
below) that I occasionally do work and gets quite tedious if I do it
manually. Thanks in advance!
jenny.
-
I have a column of data that looks like this:
NA18501
NA18502
NA18504
NA18505
NA18507
If x is your data, and is a vector, then
rep(x, each=2)
should do it for you.
Cheers,
Simon.
jenny tan wrote:
Hi there,
Wonder if someone who is R-savvy can help me with the following task (see
below) that I occasionally do work and gets quite tedious if I do it
manually. Thanks in
Hello!
I have a data set where i need to predict hotel stays in a 3 month
period by customer. I have stays for each customer in the 3 month
period and the previous 3 month period + other variables. these stays
contain an integer that ranges from 0 to 10. classic poisson distribution.
my
Here is how to do it with vectors; you can extend to a data frame:
x - NA18501
+ NA18502
+ NA18504
+ NA18505
+ NA18507
+ NA18508
+ NA18516
+ NA18517
+ NA18522
+ NA18523
+
x - scan(textConnection(x), what='')
Read 10 items
x
[1] NA18501 NA18502 NA18504 NA18505 NA18507 NA18508 NA18516
NA18517
This (below) also runs into trouble if you try to predict with new data
since you have no rule for re-constructing the formula. Also, you can't
plot the term as a single contributor to the linear predictor with
termplot().
I'm sure given enough ingenuity you can get round these two, but why
Here is another attempt. This one allows general prediction
yet its actually shorter and does not use any advanced
language constructs (although to understand why it works
one must understand that formulas have environments
and the environment of the formula corresponding to each
component of mod
zubin binabina at bellsouth.net writes:
Hello!
I have a data set where i need to predict hotel stays in a 3 month
period by customer. I have stays for each customer in the 3 month
period and the previous 3 month period + other variables. these stays
contain an integer that ranges
Hello Sir,
I am just wondering that pedump is a command of 'R' because in could not
find in the 'R' help using help.search(pedump). I am requesting you to
narrate as i also have to look into .dll(s). Is there any way to know what
are the exported functions and constants and imported functions
This refers to the windows command pedump.exe found in the Rtools
collection at:
http://www.murdoch-sutherland.com/Rtools/
On 8/2/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello Sir,
I am just wondering that pedump is a command of 'R' because in could not
find in the 'R' help using
On Wed, 2 Aug 2006, [EMAIL PROTECTED] wrote:
Hello Sir,
I am just wondering that pedump is a command of 'R' because in could not
It is not, as I stated.
find in the 'R' help using help.search(pedump). I am requesting you to
narrate as i also have to look into .dll(s). Is there any way
76 matches
Mail list logo