Hi,
Has anyone encountered the problem of rgamma function in C? The
following simplified program always dies for me, and I wonder if anyone
can tell me the reason.
#include Rmath.h
#include time.h
#include Rinternals.h
SEXP generateGamma ()
{
srand(time(NULL));
return
my system :debian
in console:
nano /home/tiger/R-2.15.1/etc/Rprofile.site
here is my content:
.First - function(){
cat(\nWelcome at, date(), \n)
}
#
.Last - function(){
cat(\nGoodbye at , date(), \n)
}
when i save it ,reopen my R ,
why there is no
Welcome at Sun Jul 15 07:53:58 2012
OK, I need help!!
I've been searching, but I don't understand the logic of some this
dataframe addressing syntax.
What is this type of code called?
test [[v3]] [is.na(test[[v2]])] -10 #choose column v3 where column v2
is == 4 and replace with 10
and where is it documented?
The code below
Hi,
I don't really understand how ROCR works. Here's another example with a
randomforest model: I have the training dataset(bank_training) and testing
dataset(bank_testing) and I ran a randomForest as below:
bankrf-randomForest(y~., bank_training, mtry=4, ntree=2,
I'm looking for a single book that provides a deep, yet readable
introduction to applied data analysis for general readers.
I'm looking for coverage on things like understanding randomness, natural
experiments, confounding, causality and correlation, data cleaning and
transforms, lagging,
Hello, I'm new to R with a (probably elementary) question.
Suppose I have a dataset called /A/ with /n/ locations, and each location
contains within it 3 time series of different variables (all of 100 years
length); each time series is of a weather variable (for each location there
is a
Dear all,
Please I am working on PCR and PLSR with pls package and my issue is the
command to extract components. Please help with a solution.
Thanks.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hi, R-help,
I have a group of data from RNA-seq want to be analyzed by Fisher's
exact test in R. I want to compare the significant difference of about
30, individuals in two different samples, and I have no idea how to use
R, so could you please give me some suggestions or the scripts
We are using GAM in mgcv (Wood), relatively new users, and wonder if anyone
can advise us on a problem we are encountering as we analyze many short time
series datasets. For each dataset, we have four models, each with intercept,
predictor x (trend), z (treatment), and int (interaction between x
Hi,
I would like to use xyplot to create a figure. Unfortunately, I cannot find
documentation in xyplot to specify alternating the x-axis tick labels with
the x-axis tick marks. I can do this with the regular R plot function as
follows.
#A small version of my data looks like this
I have a read a lot about the benefits of vectorization in R. I have a
program that takes almost forever to run. A good way to see if I have
learned something ... My problem can be summarized like this : I have a
nonlinear function of several variables that I want to optimize over one
letting the
G'day R (power) users,
I have a many vectors, called:
ib1
ib2
ib3
...
ib100
and I would like them in one data frame (df) such that:
df
ib1 ib2 ib3 ib4 . ib100
x x xxx
x x xxx
x x xxx
I have attempted:
Dear all,
I am searching for a way to compute a test comparable to Chuang et al.
(Causality in Quantiles and Dynamic Stock
Return-Volume Relations). The aim of this test is to check wheter the
coefficient of a quantile regression granger-causes Y in a quantile range. I
have nearly computed
On 12-07-14 7:54 PM, 水静流深 wrote:
my system :debian
in console:
nano /home/tiger/R-2.15.1/etc/Rprofile.site
here is my content:
.First- function(){
cat(\nWelcome at, date(), \n)
}
#
.Last- function(){
cat(\nGoodbye at , date(), \n)
}
when i save it ,reopen my R ,
why there is no
Dear All,
I've used mice package for my latent class analysis and binary logistic
regression
I've imputed five data sets and with long format I've added new variable
that shows latent class membership.
And then in addition to other variables, I'll use binary logistic
regression and try to pool
Hi,
Is there a function similar to excel's hlookup in R ?
Thanks,
Silje
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide
Dear Peter,
thanks for your clarifications. Sample size is around 200 in each group. Would
that justify your approach?
I found a couple of more tests for scale on continous variables, ie.
Mood Test
Ansari-Bradley Test (that one is also implemented in R)
Klotz Test
Conover Test
Would one of
Dear all,
I have dataset which contains date and time in the format
yearmonthdayhour. I can read in these data correctly as follows:
mydata - read.csv(pm10_corine_gridcel_hourly_2011.csv, header = TRUE)
mydata$date - as.POSIXct(strptime(mydata$date, format = %Y%m%d%H,
tz=UTC))
However, midnight
Here's some data (which should give you the error messages):
# read in data
data - read.csv(https://dl.dropbox.com/u/13631687/data.csv;, header =
T, sep = ,)
# first paste all data
data1 - paste(data[,1], collapse = |)
# second paste subsets of the data
data2a -
Thanks for your suggestions!
The Siegel Tukey test and the permutation test sound promising, indeed.
I applied the wilcoxon test already, but understood that it mainly tests
differences in the medians (location), even though being sensitive to all kinds
of differences between distributions,
Hello,
I am trying to reproduce a code example from
http://www.babelgraph.org/wp/?p=358 babelgraph when compiling the function
to call the C++ code I get the following error:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not
What does Excel's HLOOKUP do?
On Saturday, July 14, 2012, Silje Nord wrote:
Hi,
Is there a function similar to excel's hlookup in R ?
Thanks,
Silje
__
R-help@r-project.org javascript:; mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
On Jul 14, 2012, at 19:58 , Schaber, Jörg wrote:
Dear Peter,
thanks for your clarifications. Sample size is around 200 in each group.
Would that justify your approach?
It's certainly better than 10...
I did a small check on the IgM data from the ISwR package (298 obs.) and found
Simplify your model. Does your TandemRepeat have a lot of levels? Or is
your sample size very small?
Alain
Dear all,
I am
fitting a hurdle model in the following way:
HNB -
hurdle(chro ~ as.factor(TandemRepeat)| as.factor(TandemRepeat), data
=data_negbin_fin,
dist = negbin)
But the std.
# Thank you, Michael: it works fine!
--
View this message in context:
http://r.789695.n4.nabble.com/Getting-objects-from-quantmod-ticker-list-tp4635708p4636440.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
# I've read that rollapply, and its wrapper apply.rolling()
# from PerformanceAnalytics package, do not work with multivariate
# time series neither their output can be a multivariate time series.
# Then I was wondering if any other function like those exists, or
# if I need to write my own
Hi Antony,
There is still some confusion as to what you actually want as result.
For example, your statement
-In this i need to check each particular column values are between Max and
Min value.
If the coulmn value not coming between Max and Min, then i need to create
another coulmn
This
Hi,
Try this:
dat1-read.table(text=
ABC XYZ PQR
2 4 3
5 4 8
7 1 3
,sep=,header=TRUE)
newdat-apply(dat1,2,function(x) ifelse(x6 x3,,RC))
colnames(newdat)-paste(colnames(newdat),QF,sep=_)
Hi,
You could use either one of these methods:
#Method 1:
#dat1 : data
list1-split(dat1,dat1$group)
dat2-data.frame(list1)
dat2-data.frame(list1[[5]][1],list1[[4]][1],list1[[3]][1],list1[[2]][1],list1[[1]][1])
colnames(dat2)-c(rev(levels(dat1$group)))
head(dat2)
Group 1 Group 2 Group 3
- Forwarded Message -
From: arun smartpink...@yahoo.com
To: Akkara, Antony (GE Energy, Non-GE) antony.akk...@ge.com
Cc: R help r-help@r-project.org
Sent: Friday, July 13, 2012 10:05 AM
Subject: Re: [R] Column create and Update using function
Hi,
I thought you want to check all the
Hi Peter,
I copied the data from your email and run it again.
dat1-read.table(text=
2.5 3.6 7.1 7.9
100 3 4 2 3
200 3.1 4 3 3
300 2.2 3.3 2 4
,sep=,header=TRUE)
dat1
X2.5 X3.6 X7.1 X7.9
100 3.0 4.0 2 3
200 3.1 4.0 3 3
300 2.2
Hello,
Try the following.
ib1 - 1:10
ib2 - rnorm(10)
hold.list - objects(pattern=ib)
df - sapply(hold.list, get)
df
Note that you don't need list(), and that sapply() returns a data.frame
if possible.
Also, 'df' is the name of an R function, use something else like 'df1'.
Hope this
On Jul 14, 2012, at 04:55 , Chandler Zuo wrote:
Hi,
Has anyone encountered the problem of rgamma function in C? The following
simplified program always dies for me, and I wonder if anyone can tell me the
reason.
#include Rmath.h
#include time.h
#include Rinternals.h
SEXP
Hello,
Why do you need 9 variables in your environment if they are time series
that correspond to the same period? You should use time series functions.
#install.packages('zoo')
library(zoo)
# Make up a dataset
Year - seq(from=as.Date(1901-01-01), by=year, length.out=100)
dat -
On Fri, Jul 13, 2012 at 1:41 PM, mdvaan mathijsdev...@gmail.com wrote:
Here's some data (which should give you the error messages):
# read in data
data - read.csv(https://dl.dropbox.com/u/13631687/data.csv;, header =
T, sep = ,)
# first paste all data
data1 -
On Fri, Jul 13, 2012 at 9:25 PM, Silje Nord silje.nordg...@gmail.com wrote:
Is there a function similar to excel's hlookup in R ?
Try match(). I think it provides hlookup() functionality.
Liviu
__
R-help@r-project.org mailing list
To the R help list,
When using a data frame, there is no warning or error message
when I refer to a non-existent variable inside the data frame.
Example:
##--
a - c(1,2,3)
b - c(11,22,33)
df - data.frame(a,b)
df
## correct: there is a column in df
This seems more or less correct to me.
1 sum(df$a==1)
[1] 1
1 sum(df$a==2)
[1] 1
1 sum(df$aaa==2)
[1] 0
There is no df$aaa so the length is 0 which is what I think you are asking.
What am I missing?
John Kane
Kingston ON Canada
-Original Message-
From: paulo.bar...@ensp.fiocruz.br
Dr. Dalgaard,
Thank you. But pre-checking with is.null() or using with()
doesn't solve the problem of catching spelling mistakes
in the name of a variable inside a data frame, when using
the df$var notation often in a program.
Is there some way for R to behave, in relation to a variable
On Jul 15, 2012, at 17:41 , Paulo Barata wrote:
Dr. Dalgaard,
Thank you. But pre-checking with is.null() or using with()
doesn't solve the problem of catching spelling mistakes
in the name of a variable inside a data frame, when using
the df$var notation often in a program.
Is there
Hello,
Thank you, I'm gald it helped. Two notes.
1. I don't believe 1t's a problem with the documentation, though many
times, and R is not an exception, there are books that explain in
simpler terms what the docs alreay explain well. Check out the
contributed link in
On 2012-07-15 08:41, Paulo Barata wrote:
Dr. Dalgaard,
Thank you. But pre-checking with is.null() or using with()
doesn't solve the problem of catching spelling mistakes
in the name of a variable inside a data frame, when using
the df$var notation often in a program.
Is there some way for R
Hi,
I have a dataset which contains several time records for a number of days, plus
a variable (light) that allows to determine night time (lihgt= 0) and daytime
(light 0). I need to obtain get dusk time and dawn time for each day and place
them in two columns.
This is the starting point
Hello, again.
Inline.
Em 15-07-2012 16:17, Charles Stangor escreveu:
Rui,
Since you are so generous, may I ask you one more question? What is the
deal with the text after the semicolon in the statement below? Is this
an ifelse or something? Why is it needed ?
obrigado.
df1 -
On 2012-07-13 01:05, Martin Ivanov wrote:
Dear R users,
I need to add minor axis ticks to my graph. In traditional R this is easily
achievable by simply
adding a second axis with the minor ticks. But how to do that in trellis? I am
already out of ideas.
Any suggestions will be appreciated.
Dr. Dalgaard,
Thank you. You are right, with() is able to catch
spelling errors in the name of variables inside a data frame.
But couldn't some error or warning be included in R when referring
to a non-existent variable inside a data frame with the df$var
notation, without the use of with()?
* Sam Steingold f...@tah.bet [2012-07-13 15:51:46 -0400]:
How do I read/write liblinear models to files?
E.g., if I train a model using the command line interface, I might want
to load it into R to look the histogram of the weights.
Or I might want to train a model in R and then apply it
No idea of how to do what you want but your data set is not working.
I think that you want
x= c(1:24)
day= rep(1:30, each=10)
time= sample(x, 300, replace= T)
light= rep(c(20,10,6,0,0,0,0,0,8,20), 30)
d=data.frame(day,time,light)
n= length(day)
John Kane
Kingston ON Canada
-Original
Hello,
There are obvious bugs in your code, you are testing for light 2 or
ligth 2 but this would mean that dusk and dawn are undetermined for
light == 2 and that they happen at light == 1.
Without loops or compound logical conditions:
f - function(x){
x$dawn - x$time[
Hello,
Right, it should be 'varNames' in the apply. I guess I had something
called colNames in my environment. I've just rm(list=ls()) and rerun the
code, corrected. No errors this time.
varNames is the result of expand.grid, therefore does have a dim attribute.
The faulty instruction
Dear all,
Is anyone aware of an R implementation of LoOF (H.-P. Kriegel, P. Kröger, E.
Schubert, A. Zimek; LoOP: Local Outlier Probabilities; In Proceedings of the
18th ACM Conference on Information and Knowledge Management (CIKM), Hong
Kong, China: 1649–1652, 2009.)? I found http://cran.r-
Paulo Barata-3 wrote
Dr. Dalgaard,
Thank you. You are right, with() is able to catch
spelling errors in the name of variables inside a data frame.
But couldn't some error or warning be included in R when referring
to a non-existent variable inside a data frame with the df$var
Depending on what options of hlookup you want, 'match' will do exact
matching and 'findInterval' will determine range/interval matching.
What you need to do is follow the posting guide and provide an example
of exactly what you data looks like and what you expect the result to
be.
On Fri, Jul 13,
Try ?match
Adapt it to your need
On Saturday, July 14, 2012 12:55:33 AM UTC+5:30, Silje Nord wrote:
Hi,
Is there a function similar to excel's hlookup in R ?
Thanks,
Silje
__
R-help@r-project.org mailing list
Holger,
Thanks for providing a reproducible example. However, since your
space key only works sporadically, the below is a little hard to read... ;)
On 2012-07-12 20:26, Holger Taschenberger wrote:
Hi,
I'm trying to run a permutation test on paired samples.
First I tried the
Hi Greg,
Thanks for your response. So far I've just been asked to investigate what the
analysis likely would involve. The hope was that there were be some sort of
quick and easy canned approach. I don't really think this is the case though.
If I'm asked to do the actual analysis itself, I'll
Dear all,
I have a data frame with different variables and I want to build different
subsets out of this data frame using some conditions and I want to use a
loop because there will be a lot of subsets and this would be saving a lot
of time.
I try to give you an overview about my data
Hi,
I guess you can try this:
#You will get the same result here:
df$aaa==2
logical(0)
!df$aaa==2
logical(0)
#But it is different for the variable present in the dataframe
df$a==4
[1] FALSE FALSE FALSE
!df$a==4
[1] TRUE TRUE TRUE
identical(df$aaa==2,!df$aaa==2)
[1] TRUE
I looks like you want to use the 'split' function which would create a
list of dataframes with the various conditions:
result - split(Baumdaten, list(Baumdaten$transectID,
Baumdaten$Baumart), drop = TRUE)
On Sun, Jul 15, 2012 at 11:31 AM, burton030 burto...@hotmail.de wrote:
Dear all,
I have
Hi there and thanks in advance.
I have a large symmetrical matrix stored in a text file. After load in R I
would like to extract the same number of columns and rows (symmetrical
submatrix) using their labels.
I have tried this code in order to extract columns, but R console gives me the
+
For a start, you are missing a quote and a parenthese on the
statement; probably should be: (another quote was also missing)
n-subset(m, select=c(X1, X7, X12,X15, X22, X26, X31,
X34, X39, X44, X51, X58))
Not sure what you want with the rownames; an example would help and
post with 'dput'.
On
You're missing a )
You close c() but not subset().
That's the most common cause of incomplete commands: it often works to
just keep typing ) return until you get the regular prompt.
Sarah
On Sun, Jul 15, 2012 at 2:47 PM, A J anxu...@hotmail.com wrote:
Hi there and thanks in advance.
I have
try this:
set.seed(1)
day= rep(1:30, each=10)
n= length(day); x= c(1:24)
time= sample(x, 300, replace= T)
light= rep(c(20,10,6,0,0,0,0,0,8,20), 30)
d=data.frame(day,time,light)
# create a dawn/dusk column to mark where it happens
d$dawn - c(FALSE, (head(d$light, -1) 2) (tail(d$light,
Sorry so much for mistakes.
It was an example code and I commited some mistakes typing it. But meaning the
original code is right (I have checked several times) I am not sure about how
to solve the problem of extracting columns and rows using labels from a squared
matrix. I have enclosed a
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Sandy Adriaenssens
Sent: Friday, July 13, 2012 3:52 AM
To: r-help@r-project.org
Subject: [R] read mignight as 24:00 and not as 0:00
Dear all,
I have dataset which contains
Is this what you want:
x - read.table(text = X1 X7 X12 X15 X22 X26 X31 X34 X39 X44 X51
+ X1 1 2 3 4 5 6 7 8 9 10 11
+ X7 11 9 7 5 3 1 10 8 6 4 2
+ X12 3 4 7 8 5 7 2 9 1 3 2
+ X15 9 9 8 4 7 1 1 3 2 5 3
+ X22 6 7 7 4 4 2 9 8 8 1 1
+ X26 3 9 4 8 5 7 6 1 2 3 8
+ X31 1 2 1 3 1 4 1 5 1 6 1
+ X34 6 7
On Fri, Jul 13, 2012 at 7:55 PM, Chandler Zuo z...@stat.wisc.edu wrote:
Hi,
Has anyone encountered the problem of rgamma function in C? The following
simplified program always dies for me, and I wonder if anyone can tell me
the reason.
#include Rmath.h
#include time.h
#include
Hi there and thanks in advance.
Nowadays I am working on the plug-in bandwidth selection with R. Firstly, my
1010 data is the return rate from Yahoo Finance.
Secondly, my code is following:
r=read.table(/Users/user/Desktop/research/a.txt,sep=,,header=TRUE)
x-r[8:1010,]
library(KernSmooth)
Hello,
Try this:
dat1-read.table(text=
X1 X7 X12 X15 X22 X26 X31 X34 X39 X44 X51
X1 1 2 3 4 5 6 7 8 9 10 11
X7 11 9 7 5 3 1 10 8 6 4 2
X12 3 4 7 8 5 7 2 9 1 3 2
X15 9 9 8 4 7 1 1 3 2 5 3
X22 6 7 7 4 4 2 9 8 8 1 1
X26 3 9 4 8 5 7 6 1
http://r.789695.n4.nabble.com/file/n4636585/Baumdaten_aufbereitet.csv
Baumdaten_aufbereitet.csv
Here you have an overview about my data frame...
--
View this message in context:
http://r.789695.n4.nabble.com/computing-a-subset-using-a-loop-tp4636564p4636585.html
Sent from the R help mailing
Hi,
thanks for your reply but this code just gives me a list but no subsets but
I need subsets because I want to do some calculations with these subsets and
want do make some plots etc. Is there a solution for my problem? I ve posted
an example for the first subset...
Dear R-Users,
I have a problem on extracting T-Stat and P-Value. I have written R-code below
library(Matching)
data(lalonde)
attach(lalonde)
names(lalonde)
Y - lalonde$re78
Tr - lalonde$treat
glm1 -
glm(Tr~age+educ+black+hisp+married+nodegr+re74+re75,family=binomial,data=lalonde)
On 2012-07-15 10:01, Paulo Barata wrote:
Dear Peter,
Thank you. I will try to modify my programming habits.
But it seems there is a flaw in R, when it accepts a reference
to a non-existent variable inside a data frame with the df$var
notation. This should be corrected somehow.
Paulo Barata
On 2012-07-15 14:37, shyam basnet wrote:
Dear R-Users,
I have a problem on extracting T-Stat and P-Value. I have written R-code below
library(Matching)
data(lalonde)
attach(lalonde)
names(lalonde)
Y- lalonde$re78
Tr- lalonde$treat
glm1-
Here is an example of using your data to split it into the subsets and
then computing a summary of each subset. You have to remember that
what is returned from 'split' is a 'list' of 'data.frames' that as the
subsets that you want and then use use 'lapply' to process each of the
subsets in the
Extract the date separately from the time initially, and keep it separate. When
you want to process daily data, use that column.
---
Jeff NewmillerThe . . Go Live...
Is it possible to start R-Gui in a windowed state under windows? (I am running
Windows 7 and Vista)
I have the set the property for R icon to normal window option, but that has
no effect.
Thanks.
__
R-help@r-project.org mailing list
I have also reinstalled the MuMIn package as suggested at...
http://r.789695.n4.nabble.com/Error-message-number-of-items-to-replace-is-not-a-multiple-of-replacement-length-td3257893.html
...however, this made no difference.
any help is appreciated.
thank you
--
View this message in context:
Hello,
In my previous email, I used index to subset the data. Then, I looked at your
code. I guess you wanted to try the subset function to get the same output.
Try this:
dat1-read.table(text=
X1 X7 X12 X15 X22 X26 X31 X34 X39 X44 X51
X1 1 2 3 4 5 6 7 8 9 10 11
X7 11 9 7 5
Hi,
I'm trying to install RSQLite on R 2.14 Ubuntu 12.04 i686. The installation
always gets stalled and ends up not working. I installed libsqlite3-dev but
still no luck. Anyone know how to solve this?
$ R CMD INSTALL RSQLite_0.11.1.tar.gz
* installing to library
hi,
i am new to r ,i have a xlsx data with me with 12 sheet in it and
need to convert it to csv first and then need to convert it into time
series ,so if u can pls guide me a little how to do it.
Regards
karan
[[alternative HTML version deleted]]
Hi
I got the following error using as.xts
Error in xts(x, order.by = order.by, frequency = frequency, ...) :
NROW(x) must match length(order.by)
Here is how the data looks like
d1 - read.csv(file.path(dataDir,AppendixA-FishCountsTable-2009.csv),
as.is=T)
d1[1:3,]
dive_id date time
82 matches
Mail list logo