Displaying 20 results from an estimated 30000 matches similar to: "what's the R command to make the following?"
2010 Mar 12
3
how to plot only the upper triangle using the pairs function?
Hi,
I am trying to use function pairs to plot the scatterplot, but I only want
to keep the upper triangle, what's the argument to do this?
Thanks,
-Jack
[[alternative HTML version deleted]]
2011 Aug 17
2
question regarding gregexpr and read.table
Hi,
I have a silly question regarding the usage of two commands: read.table and
gregexpr:
For read.table, if I read a matrix and set header = T, I found that all the
dash ("-") becomes dots (".")
A = read.table("Matrix.txt", sep = "\t", header = F)
A[1,1]
# "A-B-C-D".
A = read.table("Matrix.txt", sep = "\t", header = T)
2009 Nov 10
1
how to suppress the output from stepAIC?
Hi,
I am now running a cross-validation using coxph coupled with stepAIC for
model selection, is there anyway to suppress the output? It's too much.
-Jack
[[alternative HTML version deleted]]
2011 Aug 17
1
question regarding headers with space in the names
Hi,
After I read an xlsx file into the work space:
A <- read.xlsx("B.xls", header = T, check.names = F)
There are several headers with the names like:
colnames(A) [1:4]
# [1] "A 1" "B"
[3] "C 2" "D"
I can get the content of column 2 and column 4 easily by
A$B or A$D
However, I can not type
2008 Dec 09
1
Can elastic net do binary classification?
Hi, List
The elastic net package (by Hastie and Zou at Stanford) is used to do
regularization and variable selection, it can also do regression. I am
wondering if it can perform binary classification (discrete outcome).
Anybody having similar experience?
Many thanks,
-Jack
[[alternative HTML version deleted]]
2008 Jan 10
1
question on how to extract values from atomic vector
Dear List,
I have an atomic vector named "Results"
Results
[1] 1 1 1
attr(,"prob")
[1] 0.6666667 1.0000000 1.0000000
Levels: 0 1
when I type
attributes(Results)
$levels
[1] "0" "1"
$class
[1] "factor"
$prob
[1] 0.6666667 1.0000000 1.0000000
However, when I type
Results$prob
It has the following warning message:
NULL
Warning message:
In
2008 Jan 19
1
how to use different variable to store values with different length in a loop
Hi, List
I am trying to use variables named A1, A2, ..., A100 to store some values,
each variable could store some values with different length, how can I
achieve this?
Thanks,
Jack
[[alternative HTML version deleted]]
2010 Jul 14
1
question about SVM in e1071
Hi,
I have a question about the parameter C (cost) in svm function in e1071. I
thought larger C is prone to overfitting than smaller C, and hence leads to
more support vectors. However, using the Wisconsin breast cancer example on
the link:
http://planatscher.net/svmtut/svmtut.html
I found that the largest cost have fewest support vectors, which is contrary
to what I think. please see the scripts
2003 May 22
1
Re: dates in chron package, split warning message
>
> > Dear All,
> >
> > I am currently using R for windows.
> >
> > I am wondering why the dates command in chron package does not work in
the
> > following situation:
> >
> > cut(dates(c(23,45,67),origin=c(1,1,2004)),"months")
> >
> > but will work for:
> >
> >
2000 Apr 05
1
problem with survexp in survival5
survexp in survival5 doesn't seem to work for me. see below:
> library(survival5)
Attaching Package "package:survival5":
The following object(s) are masked from package:base :
sort.list
> library(chron)
> data(ratetables)
> survexp(~ratetable(year=julian(6,1,1991),
+ sex=1,age=35*365.24),times=(0:30)/6*365.24)
Error in as.character(as.date(c(min(R[, 3]),
2000 Feb 15
1
locfit for R 0.99.0
I've updated the locfit library, with R 0.99.0 compatability and other
changes. The new version is propagating through CRAN, or available
from my webpage, http://cm.bell-labs.com/stat/project/locfit.
Also with regard to distribution accuracy, these might be of interest -
http://cm.bell-labs.com/stat/clive/dbinom.ps (document)
http://cm.bell-labs.com/stat/clive/dbinom.c (c source code).
2008 Jan 15
4
how to go to a line in R
Hi, List
When I was writing R code, I notice that there is no number indicating how
many lines of codes you are writing. Is there a way to go to a line with
defined number? say I want to go to the 20th line.
Thanks,
Jack
[[alternative HTML version deleted]]
2003 Dec 04
5
Processing calendar dates with R
I am a beginner in R with a background in SAS.
Are there built-in R methods of reading dates for calculating elapsed days
between two calendar dates? If so, are there any examples I can browse?
Thanks in anticipation.
John Byrne.
Lecturer in Information Systems.
Australian Catholic University.
2010 Apr 16
1
R CMD check tells me 'no visible binding for globalvariable'
Henrik wrote:
I think what people are also thinking about is that the policy for
publishing a package on CRAN is that it have to pass R CMD check with
no errors, warnings *or* notes. So, in that sense notes are no
different from warnings.
---------------------------------
Getting rid of these notes would be very hard in the survival package.
The population survival routines (survexp, pyears)
2007 Jun 20
1
making a Time of Day axis
I am wrestling with time and date data. I came up with a way to plot and
label a histogram with "time of day" on the x-axis, but it seemed like a
lot more work than should be necessary. Is there a better way to do what
I am trying to do?
require(chron)
# read input data
data = read.table("input.dat", header=T)
# Create date-time and chron objects
datetime =
2004 Nov 04
1
problems with seq.dates
There seem to be a bug in the seq.dates function in the chron package for R
2.0. Please see below:
when the specified frequency is "months", seq.dates does not return the end
of the specified interval all the time:
> seq.dates(from = "05/31/04", to = "12/31/04", by = "months")
[1] 05/31/04 06/30/04 07/31/04 08/31/04 09/30/04 10/31/04 11/30/04
Ciprian
2012 Jun 15
2
How to convert month-day-year to Julian data number?
Hello,
I am trying to convert calendar dates (Month, Day, Year) into Julian Days
Product code Bureau of Meteorology station number Month Day Year Date_mdy Date
4102001 70014 1 1 1939 1/01/1939 1/01/1939
4102001 70014 1 2 1939 1/02/1939 2/01/1939
4102001 70014 1 3 1939 1/03/1939 3/01/1939
4102001 70014 1 4 1939 1/04/1939 4/01/1939
4102001 70014 1 5 1939 1/05/1939 5/01/1939
4102001 70014 1 6
2007 Sep 18
5
Need help on "date"
Dear all,
I have a variable 'x' like that:
> x
[1] "2005-09-01"
Here, 2005 represents year, 09 month and 01 day.
Now I want to create three variables naming: y, m, and d such that:
y = 2005
m = 09
d = 01
can anyone tell me how to do that?
Regards,
[[alternative HTML version deleted]]
2012 Jan 03
4
Changing X axis of ggplot
Thanks to Joshua Wiley for turning me on to ggplot2.
I am making a plot using this:
p <- ggplot(dallas, aes(x = offense_hour)) + geom_bar() + coord_polar()
Dallas is a data frame, and offense_hour is a column with chron
objects from the chron library. In this case, the chron object was
created with the times function. It is only a time (H:M:S) with no
date attached.
The plot shows up fine,
2008 Jan 06
3
need help
Hi,
I'm Roslina, PhD student of University of South Australia, Australia
from school Maths and Stats. I use S-Plus before and now has started
using R-package. I used
to analyse rainfall data using julian date. Is there any similar
function that you can suggest to me to be used in R-package? Thank you
so much for your attention and help
[[alternative HTML version deleted]]