Dear,
Thanks for the warmful help on New Year's EVE.
Cross-validation is used to validate the predictive quality of the training
data with testing data.
As for the amount,
the cross-validation (cv) is supposed to be based on k-fold
cross-validation,
k-1 for the training and 1 for the testing.
Happy New Year, all!
I want to do calculations on each element of a list l, but i want the
returned list element to be named differently after the calculation.
Is it possible to do the renaming somehow within the lapply call?
l - list(a=NA, b=NA)
lapply(l, function(x)
On Jan 1, 2010, at 8:21 AM, Mark Heckmann wrote:
Happy New Year, all!
I want to do calculations on each element of a list l, but i want
the returned list element to be named differently after the
calculation.
Is it possible to do the renaming somehow within the lapply call?
l -
Thanks. Interestingly, your code works on my Mac 10.6.1 but not on my
Win XP. See sessionInfo from below.
Mac R:
sessionInfo()
R version 2.9.2 (2009-08-24)
i386-apple-darwin8.11.1
locale:
fi_FI.UTF-8/fi_FI.UTF-8/C/C/fi_FI.UTF-8/fi_FI.UTF-8
attached base packages:
[1] stats graphics
Hi David,
thanks for the answer, though I am not sure what you mean.
My aim is the following out:
input to lapply
l
$a
[1] NA
$b
[1] NA
output from lapply:
l
$new_b
[1] NA
$new_b
[1] NA
Mark
Am 01.01.2010 um 14:58 schrieb David Winsemius:
On Jan 1, 2010, at 8:21 AM, Mark Heckmann
Is this what you want:
l - list(a=NA, b=NA)
names(l) - paste(new_, names(l), sep='')
l
$new_a
[1] NA
$new_b
[1] NA
On Fri, Jan 1, 2010 at 9:48 AM, Mark Heckmann mark.heckm...@gmx.de wrote:
Hi David,
thanks for the answer, though I am not sure what you mean.
My aim is the following
Try this:
# same args as lapply. FUN must return named components.
lapplyWithRename - function(...) {
x - lapply(...)
names(x) - sapply(x, names)
lapply(x, function(x) { names(x) - NULL; x })
}
# test function - if x is A then f returns c(Name A = A)
f - function(x)
Thanks Gabor,
this is what I was looking for.
Mark
Am 01.01.2010 um 16:05 schrieb Gabor Grothendieck:
Try this:
# same args as lapply. FUN must return named components.
lapplyWithRename - function(...) {
x - lapply(...)
names(x) - sapply(x, names)
lapply(x, function(x)
Okay, I don't know if I'm blocking because of my other programming
language experience of if I'm just being dense.
I have a data.frame with high,open,low,last,day, and start_time time
columns. What I want to do is get all the rows with the same day and
process each of those columns. If I
Hum. data.frame was left off. Trying again...
On Jan 1, 2010, at 10:20 AM, donahc...@me.com wrote:
Okay, I don't know if I'm blocking because of my other programming
language experience of if I'm just being dense.
I have a data.frame with high,open,low,last,day, and start_time time
Reinstall R but this time choose the Mac version that includes tcl.
You shouldn't have to separately install it.
On Fri, Jan 1, 2010 at 11:20 AM, donahc...@me.com wrote:
Okay, I don't know if I'm blocking because of my other programming language
experience of if I'm just being dense.
I have
Hi everyone,
Can someone please help me in these questions?:
1)if I use crossvalidation with svm, do I have to use this equation to
calculate RMSE?:
mymodel - svm(myformula,data=mydata,cross=10)
sqrt(mean(mymodel$MSE))
But if I dont use crossvalidation, I have to use the
Hi, I have a zoo object with monthly frequency :
library(zoo)
dat - zooreg(rnorm(50), as.yearmon(2000-01-01), frequency=12)
Now I want to make a zoo object with daily frequency from dat wherein
value for a each day for a particular month will be value of dat at that
particular month.
Is there
Elaine,
That's a fair answer, but completely not what I meant. I was hoping
that you would elaborate on the species data of species distribution
models. What types of inputs and output for this particular modeling
application etc.
Is it the same with the function inside caret, ipred, and e1071
read.table terminates the program if the input file is empty. Is there
way to let the program continue and return me a NULL instead of
terminating the program?
$ Rscript read_empty.R
read.table(empty_data.txt)
Error in read.table(empty_data.txt) : no lines available in input
Execution halted
$
Please give reproducible example, more information on your
troubleshooting and sessionInfo(). Cannot reproduce:
pathname - empty.txt
cat(file=pathname)
print(file.info(pathname))
size isdir mode mtime ctime
empty.txt0 FALSE 666 2010-01-01 12:50:55
?try
On Fri, Jan 1, 2010 at 12:41 PM, Peng Yu pengyu...@gmail.com wrote:
read.table terminates the program if the input file is empty. Is there
way to let the program continue and return me a NULL instead of
terminating the program?
$ Rscript read_empty.R
read.table(empty_data.txt)
Error
On 01-Jan-10 20:41:52, Peng Yu wrote:
read.table terminates the program if the input file is empty. Is there
way to let the program continue and return me a NULL instead of
terminating the program?
$ Rscript read_empty.R
read.table(empty_data.txt)
Error in read.table(empty_data.txt) : no
?try
df - try(read.table(...))
if (inherits(df, 'try-error')){ what to do if file empty }
On Fri, Jan 1, 2010 at 3:55 PM, Ted Harding ted.hard...@manchester.ac.ukwrote:
On 01-Jan-10 20:41:52, Peng Yu wrote:
read.table terminates the program if the input file is empty. Is there
way to let
Please reread my original post. You run it in a shell. I run it in a script.
On Fri, Jan 1, 2010 at 2:53 PM, Henrik Bengtsson h...@stat.berkeley.edu wrote:
Please give reproducible example, more information on your
troubleshooting and sessionInfo(). Cannot reproduce:
pathname - empty.txt
On Fri, Jan 1, 2010 at 2:54 PM, Dylan Beaudette
dylan.beaude...@gmail.com wrote:
?try
This works. Thank you!
f=try(read.table(empty_data.txt))
Error in read.table(empty_data.txt) : no lines available in input
if(class(f)=='try-error') {
+ f=NULL
+ }
print(f)
NULL
On Fri, Jan 1, 2010 at 3:03 PM, jim holtman jholt...@gmail.com wrote:
?try
df - try(read.table(...))
if (inherits(df, 'try-error')){ what to do if file empty }
For the case of using try, it is better to use inherits() rather than
class(), or it doesn't matter?
On Fri, Jan 1, 2010 at 3:55
On Fri, Jan 1, 2010 at 3:19 PM, Peng Yu pengyu...@gmail.com wrote:
On Fri, Jan 1, 2010 at 2:54 PM, Dylan Beaudette
dylan.beaude...@gmail.com wrote:
?try
This works. Thank you!
f=try(read.table(empty_data.txt))
Error in read.table(empty_data.txt) : no lines available in input
One more
Hello dear R help group,
I am trying to read a .txt file, with Hebrew column names, while keeping the
column names looking well in R - but without success.
I uploaded an example file to:
http://www.talgalili.com/files/aa.txt
And am trying the command:
In the mean time, I have done some research and found following link here :
https://stat.ethz.ch/pipermail/r-sig-finance/2009q3/004677.html
Although this is close to my problem, I am not interested in any sort of
interpolation, rather fill the NA positions with corresponding month's
price. Any
On Jan 1, 2010, at 11:20 AM, donahc...@me.com wrote:
Okay, I don't know if I'm blocking because of my other programming
language experience of if I'm just being dense.
I have a data.frame with high,open,low,last,day, and start_time time
columns. What I want to do is get all the rows with
On Jan 1, 2010, at 4:42 PM, Peng Yu wrote:
On Fri, Jan 1, 2010 at 3:19 PM, Peng Yu pengyu...@gmail.com wrote:
On Fri, Jan 1, 2010 at 2:54 PM, Dylan Beaudette
dylan.beaude...@gmail.com wrote:
?try
This works. Thank you!
f=try(read.table(empty_data.txt))
Error in
Hi Tal,
You want the colnames in hebrew? Case not, may be you
can use colnames() to attrib new colnames.
bests
milton
On Fri, Jan 1, 2010 at 4:47 PM, Tal Galili tal.gal...@gmail.com wrote:
Hello dear R help group,
I am trying to read a .txt file, with Hebrew column names, while keeping
?try()
On Fri, Jan 1, 2010 at 3:41 PM, Peng Yu pengyu...@gmail.com wrote:
read.table terminates the program if the input file is empty. Is there
way to let the program continue and return me a NULL instead of
terminating the program?
$ Rscript read_empty.R
read.table(empty_data.txt)
Thanks Milton,
But your solution would work for a one time problem, but in case I'd have a
variable with Hebrew in it, or many files to process then your solution
wouldn't scale up.
Thanks anyway :)
Tal
Contact
Details:---
Hi Jorge,
Thank you for the answer, it is a lead.
Though I am unsure as to what to do next with it :)
Here is my session info:
sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
Repeat the code you found but use na.locf in place of na.spline.
On Fri, Jan 1, 2010 at 4:57 PM, Megh megh700...@yahoo.com wrote:
In the mean time, I have done some research and found following link here :
https://stat.ethz.ch/pipermail/r-sig-finance/2009q3/004677.html
Although this is close
On Jan 1, 2010, at 4:47 PM, Tal Galili wrote:
Hello dear R help group,
I am trying to read a .txt file, with Hebrew column names, while
keeping the
column names looking well in R - but without success.
I uploaded an example file to:
http://www.talgalili.com/files/aa.txt
And am trying the
You might try:
read.table(http://www.talgalili.com/files/aa.txt;, header = T,
fileEncoding = UTF-8, sep = \t)
--
David.
On Jan 1, 2010, at 5:37 PM, Tal Galili wrote:
Hi Jorge,
Thank you for the answer, it is a lead.
Though I am unsure as to what to do next with it :)
Here is my session
Am trying to do some study on bivariate binomial distribution. Anyone knows
if there is package in R that I can use to calculate the density function of
bivariate binomial distribution and to generate random samples of it.
Thanks,
--
View this message in context:
I am a novice user of R and I'm learning with R version 2.8.1, using
WinEdt_1.8.1, under Widows Vista Home Version.
## The test function below, from a vector input, returns vector values:
# and it contains an ifelsestatement
TEST- function(x) {
low- -x^2
up- x^4
ifelse(x=0,up,low )
Hi Nykee,
I checked out ??bivariate on my R installed libraries,
and found about a hundred of occurrences of bivariate.
If nobody reply you with a streigth answer, give a look at:
VGAM; splancs; sm; prada; geoR; fUtilities; fBasics;
akima; adehabitat; vegan; ade4 and spatstat packages.
bests
Dear useRs,
I want to write a function that generates all the possible combinations of
diff().
Example:
If my vector has length 5, I need the diff() until lag=4 -
c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3), diff(my.vec, lag=4))
If it has length 4, I need until lag=3 -
Look at what 'loww' is in your function. You are passing in a vector of
length 5 and that is what is being passed into integrate for 'lower' which
is expecting an object of length 1. So determine what you want to pass in
for lower (e.g., min(loww)).
On Fri, Jan 1, 2010 at 7:44 PM, roger king
Look at your function; it is returning exactly what you are asking for:
x.dif - c(diff(my.vec), diff(my.vec, lag=i)) # the first and last values
You probably want something like this:
dif - function(my.vec) {
x.diff - diff(my.vec)
for(i in 2:(length(my.vec)-1)) {
x.dif - c(x.diff, diff(my.vec,
On Jan 1, 2010, at 7:44 PM, roger king wrote:
I am a novice user of R and I'm learning with R version 2.8.1,
using
WinEdt_1.8.1, under Widows Vista Home Version.
## The test function below, from a vector input, returns vector
values:
# and it contains an ifelsestatement
TEST-
diff.zoo in the zoo package can take a vector of lags:
library(zoo)
z - zoo(seq(10)^2)
diff(z, 1:4)
There are three vignettes (pdf documents) that come with zoo that have
more info on the package.
On Fri, Jan 1, 2010 at 8:16 PM, Rafael Moral
rafa_moral2...@yahoo.com.br wrote:
Dear useRs,
I
Hello,
I am a newbie to R.
Now I am learning to draw boxplot using graphics().
I want to change the default setting of y asix.
from 0, 0.1, 0.2,0.8
to 0, 0.4, 0.8.
Please kindly share the command and thank you.
Elaine
[[alternative HTML version deleted]]
Dear,
I am a newbie to R.
Now I am learning to draw boxplot using graphics().
I want to change the vertical line penetrating the box
from dashed line
to solid line
Please kindly share the command and thank you.
Elaine
[[alternative HTML version deleted]]
Dear,
I am a newbie to R.
Now I am learning to draw boxplot using graphics().
I want to highlight the median position
with a round point and the value left (or on the top of)to the point.
Please kindly share the command and thank you.
Elaine
[[alternative HTML version deleted]]
Dear,
Regarding the methodology comparing the power of AUC generated by differernt
models,
please kindly suggest any R code available for the function.
(similar to DeLong, DeLong, and Clarke-Pearson (1988) )
Thank you very much.
Elaine
[[alternative HTML version deleted]]
Windows XP
R 2.8.1
Colleagues,
I am trying to run a function testone() and if the function completes without
error do one set of instructions, and if the function generates either a
warning or an error run another set of instructions. I have read try, and
tryCatch help screens at least 20
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain function on
the same set of columns in each of the data set. Let's take, for ex, the
typical data set is:
df1 -
I am learning the package caret, after I do the rfe function, I get the
error ,as follows:
Error in `[.data.frame`(x, , retained, drop = FALSE) :
undefined columns selected
In addition: Warning message:
In predict.lm(object, x) :
prediction from a rank-deficient fit may be misleading
I
try this (and happy new year):
DF - cbind(df1,df2,...,df100)
result - lapply(DF, function(.name){
lsfit(get(.name)$A, get(.name)$B)
})
do.call(rbind, result) # put into matrix
On Fri, Jan 1, 2010 at 10:34 PM, Girish A.R. garam...@gmail.com wrote:
Hi folks,
Wish y'all a Happy New Year
Dear R People:
I know that you can use optim for a function with several parameters.
Is there an equivalent for 2 functions, please? Or should I put
together a finite difference type of matrix, etc., please?
Thanks,
Happy New Year,
Erin
--
Erin Hodgess
Associate Professor
Department of
Dr Sorkin;
You are a smart person. Why are you unable to create a working example
that would allow testing of the code structure?
On Jan 1, 2010, at 10:27 PM, John Sorkin wrote:
coeffs - matrix(nrow=10, ncol=3)
dimnames(coeffs) -list(NULL,c(BMI,BMIsq,min))
# set row counter
n-0
#
may some one please help me to sort this out, i am trying to writ a R code
for calculating the frequencies of the amino acids in 9 different sequences,
i want the code to read the sequence from external text file, i used the
following code to do so:
x-read.table(sequence.txt,header=FALSE)
then i
On Jan 1, 2010, at 10:34 PM, Girish A.R. wrote:
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain
function on
the same set of columns in each of the data set. Let's take, for ex,
the
On Jan 1, 2010, at 11:59 PM, che wrote:
may some one please help me to sort this out, i am trying to writ a
R code
for calculating the frequencies of the amino acids in 9 different
sequences,
i want the code to read the sequence from external text file, i used
the
following code to do
If you're interested in handling outliers in analytical proficiency
testing read current and past IUPAC guidance on PT (see
http://www.iupac.org/objID/Article/pac7801x0145) and particularly
references 1, 4, 5, and 11 therein, for starters.
Although one might reasonably ask whether outliers are
On Jan 2, 2010, at 12:26 AM, David Winsemius wrote:
On Jan 1, 2010, at 11:59 PM, che wrote:
may some one please help me to sort this out, i am trying to writ a
R code
for calculating the frequencies of the amino acids in 9 different
sequences,
i want the code to read the sequence from
i know it would be better to ask R to make the data, but i need to sequence
this particular file, because it is data for some Amino Acids and i cant
play with, so i need to ask R to go through the sequence one by one, and
then give me the numbers of each letters of each sequence, i am quite
Thanks for the replies, Jim, David, and Dennis (who replied to me directly)!
To summarize, here's what worked for me:
===
dflist - list(df1, df2, df3)
lsfun - function(df) with(df, lsfit(A, B)$coef)
res - lapply(dflist, lsfun)
do.call(rbind, res)
===
cheers,
-Girish
Girish
On Jan 2, 2010, at 12:55 AM, che wrote:
i know it would be better to ask R to make the data, but i need to
sequence
this particular file, because it is data for some Amino Acids and i
cant
play with, so i need to ask R to go through the sequence one by one,
and
then give me the numbers
Dear Elaine,
The posting guide is
http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html
bests
milton
On Fri, Jan 1, 2010 at 8:53 PM, elaine kuo elaine.kuo...@gmail.com wrote:
Dear,
I am a newbie to R.
Now I am learning to draw boxplot using graphics().
Hello,
I am using the tm package and wish to suppress the output for meta. I am
defining another variable for one of the tags and don't want the value
printed on the screen. Any help would be appreciated. Thanks.
here is the commnad:
n_corp_file - meta(corpa[[n]], URI)
-Amber
62 matches
Mail list logo