This is kind of a general question about methodology more than anything. But I
was looking for fome advice. I have fit a time-series model and feel pretty
confident that I have taken this model (exponential smoothing) as far as it
will go. In other words looking at the data and the fitted
Hello,
I asked a question about what the most likely process to follow if after a
time-series fit is performed the residuals are found to be non-normal. One
peron responded and offered to help if I supplied a sample data set.
Unfortunately now that I have a sample I have lost the emai
Hello,
I have seen much discussion on Date. But I can't seem to do this simple
operation. I can convert a string to a date:
d - as.Date(DATE, format=%m/%d/%Y)
But what I want to do is extract the year and month so I can construct an
element in a ts object. Ideally I would like to see d$year
I am running R 2.9.2 and creating a PDF that I am trying to open with Adobe
Reader 9.2 but when I try to open it the reader responds with
There was an error opening this document. The file is damaged and cannot be
repaired.:
I am using the R command(s):
pdf(file=cat.pdf, title=Historical
I have an array of data.frame(s) that I would like to smooth with loess one at
a time. the array is master and the two variable that I am interested in is
Period and Quantity. So my first attempt at calling loess is:
loess(Quantity ~ Period, master[[i]])
But I get the following error:
Error:
I have downloaded all of the tools and read the readme's that I know about but
I am still getting the following error when I try to build from source:
C:\Program Files (x86)\R\R-2.9.2\src\gnuwin32make all recommended
make[1]: `Rpwd.exe' is up to date.
cp -p etc/Makeconf etc/Rcmd_environ
This is a very simple question but I couldn't form a site search quesry that
would return a reasonable result set.
Say I have a vector:
x - c(0,2,3,4,5,-1,-2)
I want to replace all of the values in 'x' with the log of x. Naturally this
runs into problems since some of the values are negative
This is probably an even more basic question but shapiro.test return both the
statistic (w) and the significance (pw) of the statistic. For this test the
null-hypothesis is that the distirbution is not normal so very small values of
pw would mean that there is very little chance that the
i believe John Fox offers another solution in his book.
Kevin
Daniel Wollschlaeger dw...@psychologie.uni-kiel.de wrote:
* On Mo, 1. Mar 2010, Ista Zahn wrote:
I've posted a short explanation about this at
http://yourpsyche.org/miscellaneous that you might find helpful. I'm a
As
From the notes I see that for 2.11 Hmisc is not supported and the suggestion
is made to build from source. I am on a Windows 7 platform and I got all of
the tools and successfully built 'R' from source. I changed to gnuwin32 and
entered make all recommended. Even though the tar.gz (source)
Hello,
In reading the loess description I see:
span: the parameter alpha which controls the degree of smoothing.
The default seems to be 0.75. Would it be possible to expand on this decription
so I can avoid trail and error? Can I increase this pass 'span' 1?
Qualitatively to what degree
I looked at the descriptions for uniroot and optimize and they are somewhat
different but the book reference is the same and I am wondering if there are
reasons to pick one over the other?
Thank you.
Kevin
__
R-help@r-project.org mailing list
If I have data that I feed into shapio.test and jarque.bera.test yet they seem
to disagree. What do I use for a decision?
For my data set I have p.value of 0.05496421 returned from the shapiro.test and
0.882027 returned from the jarque.bera.test. I have included the data set below.
Thank you.
If I have data that I feed into shapio.test and jarque.bera.test yet they seem
to disagree. What do I use for a decision?
For my data set I have p.value of 0.05496421 returned from the shapiro.test and
0.882027 returned from the jarque.bera.test. I have included the data set below.
Thank you.
I have a small request regarding this append feature. As it is now if the
data is appended to the file so is the header. I would like to have the header
only entered once and appends just append the data.
Doable?
Kevin
Patrick Connolly p_conno...@slingshot.co.nz wrote:
On Tue,
I have a small request regarding this append feature. As it is now if the
data is appended to the file so is the header. I would like to have the header
only entered once and appends just append the data.
Doable?
Kevin
Patrick Connolly p_conno...@slingshot.co.nz wrote:
On Tue,
I give up. Maybe it is my search (Windows) but I cannot seem to find the
definition of the F77_CALL or F77_NAME macros. Either there are too many
matches or the search just doesn't find it. For example where is the source for:
F77_CALL(dpotri)
?
Thank you.
Kevin
Forgive me if I missunderstand a basic Eigensystem but when I present the
following matrix to most any other LinearAlgebra system:
1 3 1
1 2 2
1 1 3
I get an answer like:
//$values
//[1] 5.00e+00 1.00e+00 -5.536207e-16
//$vectors
// [,1] [,2] [,3]
I am trying to check the results from an Eigen decomposition and I need to
force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l'
is the eigen value and x is the eigen vector corresponding to the eigenvalue.
'R' returns the eigenvalues as a vector (e - eigen(A);
I am trying to check the results from an Eigen decomposition and I need to
force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l'
is the eigen value and x is the eigen vector corresponding to the eigenvalue.
'R' returns the eigenvalues as a vector (e - eigen(A);
True, porting old C and Fortran code to C# or F# would be a pain and probably
riddled with errors but it is not too soon to start looking to see if there is
a better way. There have been numerous ports of LAPACK, BLAS, etc. to C#. Maybe
they could be leveraged.
Maybe just allowing packages to
I am trying to build R-2.9.2 from source on a Windows 7 machine. I have
installed all of the requisite software and followed the instructions. I also
could have sworn that I had a successful build. But now I get the following
error.
gcc -std=gnu99 -shared -s -mwindows -o R.dll R.def console.o
I found the problem but not a solution. It turns out if I add the following
lines to dqrdc2.f I get the error:
write(*,300) ldx,n,p
300 format(3i4)
I don't get a compile error but I get the seemingly unrelated error in linking
R.DLL
I guess the question now is, How do I add a
Thank you for the tip. I was used to inserting write statements and was
surpised when it didn't work and reading this section I see that I shouldn't
have been doing this anyway.
One more question. Is there another call that I can use to print out a
2-dimensional array? Since FORTRAN stores as
I am testing 'qr' with an admittedly contrived matrix and I am getting
different results than I am from another package. The matrix that I am using is:
x - matrix(seq(.1, by=.1, length.out=12), 4)
So the whole test is:
x - matrix(seq(.1, by=.1, length.out=12), 4)
qr(x)
And the output from 'R'
I am just curious. Every once and a while I see an attribute attached to an
object called assign. What meaning does this have? For example:
dist ~ speed, data=cars
forms a matrix like:
num [1:50, 1:2] 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, dimnames)=List of 2
..$ : chr [1:50] 1 2 3 4 ...
..$
I am just curious. Every once and a while I see an attribute attached to an
object called assign. What meaning does this have? For example:
dist ~ speed, data=cars
forms a matrix like:
num [1:50, 1:2] 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, dimnames)=List of 2
..$ : chr [1:50] 1 2 3 4 ...
..$
I read in the documentation for split:
‘split’ divides the data in the vector ‘x’ into the groups defined by ‘f’.
But I am still unclear as to its function. Take for example:
x - 1:4
split(x, c(0,1))
$`0`
[1] 1 3
$`1`
[1] 2 4
I am not clear on how this result is reached.
Thank you.
Kevin
I have a statement:
cat(myforecast ETS(, paste(object$components[1], object$components[2],
object$components[3], object$components[4], sep = ,), ) , n, \n)
That generates:
cast ETS( A,N,N,FALSE ) 3
Anyone guess as to why the first 5 letters are truncated/missing?
Kevin
So then I am to assume that the output of 'cat' can be truncated by passing it
bad arrays. That is the only difference between the reproducible code you
show and mine. It is just a theory but say that the components array is not
dimmensioned for 4 elements. It seems a little strange if that is
It has to be related to 'cat' because the output of 'cat' is truncated. I am
just tyring to find out some possible reasons as to why it is truncated. I have
been unable to form an array like is in the test program. Do you think there is
something else that is gobbling up the output from cat
Simple question:
Why doesn't the following work? Or what 'R' rule am I missing?
tclass - Testing 1 2 3
if(tclass == Testing 1 2 3)
{
cat(Testing, tclass, \n)
}
else
{
cat(tclass, \n)
}
I get an error 'else' is unexpected.
Thank you.
Kevin
I like the fact that in subtracting two time series objects that there is some
effort to align the series. So if I have a time series of that begins at 1 and
one that begins at 2 a subtraction operation makes sure that the proper values
are subtracted. But I am unclear as to the best way to
Doing ?factor I get:
x a vector of data, usually taking a small number of distinct values.
levels an optional vector of the values that x might have taken. The default is
the set of values taken by x, sorted into increasing order.
So if I do:
factor(letters[1:20],level=seq(1:20)
[1] NA NA
I am not there yet. I cannot seem to find the package:
install.packages(SHAPE)
Warning in install.packages(SHAPE) :
argument 'lib' is missing: using 'F:\Users\Kevin\Documents/R/win-library/2.7'
Warning message:
package ‘SHAPE’ is not available
Is it called something else?
Kevin
hadley
This may be a begining question. If so, please bear with me.
If I have some data that based on the historgram and other plots it looks
like a beta distribution. Is there a function or functions within R to help me
determine the model parameters for such a distirbution? Similarily for other
I have a set of data that is basically sales figures for a given year. It has
columns for Yeaqr, Day Of Year, Sku, SubCatetory, and Category. The first few
lines of data look like:
Year DayOfYearSku Quantity CatId Category SubCategory
1 2007 1 1000911 10862
Is there a likelihod function for the Weibull distribution in 'R'? I found the
following reference:
http://www.weibull.com/LifeDataWeb/weibull_log_likelihood_functions_and_their_partials.htm
But I had a hard time understanding the parameters required Particularly
'number of groups of
I looked at 'merge'. What if df1 and df2 are data.frames and I want to merge on
on column and sum on another? Say df1 and df2 are data.frames with columns
'ID1', 'ID2', 'ID3', and 'Qty'. I want to 'merge' the data frames (and produce
a new data.frame) if there is a matching 'ID2' in each
This is probably an extemly easy operation I just could not find out how to do
it.
I simple want to append to a vector.
a - c(1,2,3,4)
a - union(a, c(5))
I want to append the value 5 or even another vector. Or is the a better way?
Kevin
__
I seem to remember this topic coming up before so I decided to look at the
archive and realized that I didn't know where it was. Is there a searchable
archive for this list? Thank you.
My question is calling a function from within a function. I have
smerge - function(d1,d2) {
temp -
again.
|
| Kevin
| Ben Bolker [EMAIL PROTECTED] wrote:
| rkevinburton at charter.net writes:
|
| If I have some data that based on the historgram and other plots it
looks
| like a beta distribution. Is there
| a function or functions within R to help me determine the model
I have a simple command to export a data.frame:
write.csv(output, TotalPredicted2008.dat)
The structure of the data.frame can be seen with:
head(output)
DayOfYear Sales
1 1 1429
2 2 3952
3 3 3049
4 4 2844
5 5 2219
6 6 2340
But it seems
I have a beginner question. After I finally get the data to a data.frame that I
can work with I have the following a data frame that is fairly long:
length(r2007)
[1] 17409
If I look at the first element:
r2007[1]
$`19`
DayOfYear Quantity
1661
2 1281
3
I have mange to use the library reshape to give me data structures that I want.
Specifically:
m2008 - melt(t2008, id.var=c(DayOfYear,Category,SubCategory,Sku),
measure.var=c(Quantity))
m2007 - melt(t2007, id.var=c(DayOfYear,Category,SubCategory,Sku),
measure.var=c(Quantity))
r2008 -
Because of machine memory restrictions I think I need to go with a vector by
vector approach. When I concatenate I get:
m - melt(t, id.var=c(DayOfYear,Category,SubCategory,Sku),
measure.var=c(Quantity))
Error: cannot allocate vector of size 7.8 Mb
Kevin
hadley wickham [EMAIL PROTECTED]
I have a slightly different question. Rather than build the list all at once I
would like to know how to append. Essentially ending up with a list of lists.
Something like:
x - c(31,2,3)
a - list(list(x))
x - c(42,3,5)
a - append(a, list(x))
Can it be done this way? So now the length(a) is 2
I have a list
List(Sku= , Shape=1, Scale=3, DayOfYear=daylist)
Note: picture daylist as c(2,3,4,3) it is a list with variable length.
Then I have a list of lists
al - c(al, List(List(Sku= , Shape=1, Scale=3, DayOfYear=daylist))
Note: same comment on daylist as above.
So far this creates a list
I would like to read it (the data) iinto a different application (not 'R').
Within 'R' I can
mlist[[1]]
mlist[1]
[[1]]
[[1]]$Sku
[1] 0
[[1]]$Shape
[1] 250.0586
[[1]]$Scale
[1] 91.9914
[[1]]$DayOfYear
[1] 250
OR
mlist[[2]]
mlist[[2]]
$Sku
[1] 18
$Shape
[1] 178.9637
$Scale
[1]
I tried:
cat(Sku,Shape,Scale,DayOfYear, file=SkuSalesInfo.dat, append=FALSE);
for(i in 1:length(mlist))
{
cat(mlist[[i]]$Sku, ,, mlist[[i]]$Shape, ,, mlist[[i]]$Scale,
file=SkuSalesInfo.dat, append=TRUE)
for(j in 1:length(mlist[[i]]$DayOfYear))
{
cat(,,
This is both a specific question and a general one. First, I am running
'fitdistr' from library(MASS) and I get the following:
Error in fitdistr(templist, weibull) : optimization failed
What is the cause of the error? How can I tell? Can I just catch this error,
report it and move to the next
Now this is really specific. I think the cause of the error is a small sample
size. For example. The following both fail:
fit - fitdistr(c(120), weibull)
fit - fitdistr(jiitter(c(120,120), amount=0.5), weibull)
As it is hard for me to control the sample size or the proximity of data values
in
I would like to use the 'tryCatch' function but am having a hard time getting
my head around it. In 'C' like languages try/catch/finally means try a block of
statements and if any throw an error then do the statements in the catch block
and then error or not always do the staements in the
This is another how do I do it type of question. It seems that for a function
that I have it has a hard time with lists that have a single repeated value. I
want a function (or expression) that will detect this condition. I want to
detect:
c(2,2,2,2,2)
OR
c(1)
The following is OK
c(2,3,3,2)
I would like to solve the equation is is the sum from k = i to N of
choose(N,k) * MR ^ k * (1 - MR) ^ (N - k) - 0.50 = 0
I want to solve for MR. This seems like a non-linear equation to me. But I am
having a hard time writing the function that implements the above. I could use
'for(...) as a
I have a list that is generated from the resape package function 'cast'. It
consists of three columns, Sku, DayOfYear, variable it is generated like:
r2007 - cast(m2008, DayOfYear ~ variable | Sku, sum)
Now DayOfYear can range from 1:365 but there are not necessarily that many rows
in the
That would be one source of error. Thank you.
Kevin
ONKELINX wrote:
Kevin,
Notice the subtle difference between Hadley's and your code:
Hadley
m2008$DayOfYear - factor(m2008$DayOfYear, levels = 1:365)
Kevin
m2007$DayOfYear - factor(m2008$DayOfYear, levels = 1:365)
Your are
Why does:
(shape/scale) * (1:365/scale)^(shape - 1)
return a vector of numbers but calling a function
hasard(1:365,shape,scale)
defined like:
hazard - function(x,shape,scale)
{
return (shape/scale) * (x/scale)^(shape - 1)
}
Only return a single value? It is like x becomes a single value
I have a bunch of lists that are essentially time-series with the unit of time
being 'day'. So I naturally want to generate a time-series from 1:365. I was
wondering if there is a nifty 'R' trick to turn a list with missing data (the
list may contain values at 100, 230, and 360) into a time
I am calling fft and getting a non-numeric error:
+ fit - lm(Quantity ~ DayOfYear, .sublist)
+ # Make the time series
+ x - as.numeric(rep(0,512))
+ x - merge(residuals(fit), x)
+ # Transform range to -pi - pi
+ x - x - pi
+ x - x * (2 *
If this is the case then how to I take a list of numbers (residuals in this
case) and create anothe list that is longer and padded by zeros? Maybe fft
already does this for me but as I understood it I need to pass an vector to the
fft that is of a power of 2 length. If I still need to do this
I just realized after some tips and a little digging that what I was trying to
do manually has already been done. I was trying to fit my data using 'lm'
then taking the residual data and trying to do a spectral estimate (for
seasonality) usiing fft and then passing the residual of all of that
More and more I am getting warnings from packages that I install that the
package was built with 2.7.2 (I am running 2.7.1). I would like to upgrade but
don't want to loose all of the packages that I have installed and the settings.
Is there a way to just upgrade without uninstalling and
I don't understand the output of stl. As a simple example:
y - numeric(1:365)
y[250] = 1
stl - stl(ts(y, frequency=7), s.window=periodic)
This returns without error but the results are puzzling to me. If you plot the
results it is probably easiest to visualize what I mean.
plot(stl)
This
There was a typo. I wnated to form an array so it should be:
y - numeric(365)
Now you should be able to reproduce it.
Kevin
stephen sefick [EMAIL PROTECTED] wrote:
I can't reproduce this because the data has two points 0 and one at
the ends of the data set, and I get an na.fail error.
The data is real. The fact that there are a bunch of zeros and only one value
of 1 is just the way things are. I have over 20,000 data sets and some are like
this. Admittedly this is not periodic but ideally you should see all
frequencies at various amplitudes, remniscent of the impulse
Thank you.
I am not saying the data is wrong. I can do somethiing like:
y = tread + seasonal + remainder
and it gives me back the original data almost exactly.
I just don't know how to interpret it. The data is clearly not periodic but I
was expecting to get more information about the function
I have a need to build a time series and there are a couple of aspects about
the time series object that are confusing me. First it seems that ts.union is
not doing what I would expect. For example:
x0 - rep(0,10)
x1 - rep(1,10)
xt0 - ts(x0, frequency=10)
xt1 - ts(x1, frequency=10)
st2 -
Coming from a C++ and C# background I would like to know how inheritance works
with 'R'. The classical example is I can define an abstract class 'Shape' and
have an array of 'Shape's but each instance could be a Circle, Square,
Triangle, etc. because they all derive from 'Shape'. At runtime if
I did a ?lm and it said basically to be careful when using lm and a time
series. But my question is probably more to do with my inexperience that
anything. If I have a time series object 'ti' how do I write the formula? The
response is the value at any particular time and the time is basically
I am sorry but I looked at ?lm and could not see any guidance on writting a
formula. If I have two arrays or a data set then I know how to do that (y ~ x)
but for a time series I am not sure how to write y or x.
Thank you.
Kevin
Gabor Grothendieck [EMAIL PROTECTED] wrote:
The Time
I want to fit a function to time series. If I had:
x - 1:4
y - 1:4
lm(y~x)
This would fit a simple line to the four points. But if it is represented as a
time series
x - 1:4
t - ts(x)
lm()
So I have a time series in the object t. How do I write a formula for lm? What
do I put in the
That is the thing. As a new comer to 'R' I don't understand how to write a
formula when all I have is a time series. I don't know how to express the
independent and dependent variables in a formula when the object is a time
series. So please just solve this simple example and I will extrapolate
I am using the function 'spectrum'. It returns two arrays that are interesting
to me. One would be the wieght or density of a given frequency with the
irequency given in another array. I would like to take the top 'n' weights
which would be the top 'n' frequencies contributing to the signal.
Please forgive me if this has been asked before but I could not readily find an
answer. First, from the example I was able to determine that graphics device
commands such as plot can be redirected using 'png' and 'bmp' type commands. I
tried this and it works as I understand it. The question is
Is there a mod (like C '%' operator) operator in 'R'? I tried to
help.search(mod) and there were too many hits for the query to be useful.
Kevin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Thank you. I definitely did not want Mod.
Kevin
Peter Dalgaard [EMAIL PROTECTED] wrote:
Csardi Gabor wrote:
?%%
Yup. Notice, by the way, that modulus [sic] is ambiguous:
Mod(1+1i)
[1] 1.414214
46 %% 7
[1] 4
Gabor
On Mon, Sep 08, 2008 at 11:58:45AM -0700,
Once the series has been decomposed into the seasonal, trend, and remainder
components with stl is there a 'predict' like function that I can use this data
to forecast the next 'n' values? I didn't see one in the stl documentation. So
if such a function does not exist I was wondering if I could
For the command 'spectrum' I read:
The spectrum here is defined with scaling 1/frequency(x), following S-PLUS.
This makes the spectral density a density over the range (-frequency(x)/2,
+frequency(x)/2], whereas a more common scaling is 2π and range (-0.5, 0.5]
(e.g., Bloomfield) or 1 and
Does anyone know why I get the following error when trying tsdiag?
Error in UseMethod(tsdiag) : no applicable method for tsdiag
I am invoking it as: tsdiag(mar).
Thank you.
Kevin
__
R-help@r-project.org mailing list
I don't have a solution but I receive the same error when trying to fit a GARCH
model using the garchFit in the fGarch package.
Kevin
Desislava Kavrakova [EMAIL PROTECTED] wrote:
Hello everyone,
I'm trying to estimate the parameters of the returns series attached using
the GARCH code
I have a set of data that is basically 3+ years of data. It is daily sales for
this year and then back 3 years so there are 3*365 + 231 days or 1326 days of
data. Since this is a time series I have constructed it as:
Start = c(1, 1)
End = c(4, 231)
Frequency = 365
In trying to ayalyze this
I would like to decompose the log of a time series. There will be time slots
that are zero. In order to handle this I insert 'NA' for all of the zeros in
the time series. Having a zero value is a very legitamate value. With those NAs
in the time series stil requires an na.action argument
I think if you use 'order' it will return the indexes of the array, sorted.
Then you can get the original index back because the array will not be changed.
Kevin
Peng Jiang [EMAIL PROTECTED] wrote:
Dear R experts,
i have a vector z , i have to do something after z is sorted. how
For purely educational purposes I would like to see the spectrum of a kernel. I
tried:
spectrum(kernel(daniell, 100), taper=0, log=no)
but I get:
Error in complete.cases(object) : not all arguments have the same length
I can plot the kernel but that is only in the time-domain. I would like to
I have been working with the base time series object (ts) and I had a couple of
questions that hopefully this group can help me with:
1) What is the best why to append an observation to an existing time-series?
Suppose I have a time series:
t - ts(1:12, frequency=5)
This would generate two
Hello,
I am calling the auto.arima method in the forecast package at it returns what
seems to be valid Arima output. But when I feed this output to 'predict' I get:
Error in predict.Arima(catall.fit[[.index]], n.ahead = 12) :
'xreg' and 'newxreg' have different numbers of columns
Is there a
I know you don't want to adopt a new text editor but Tinn-R can 'comment' a
block of code (inserting # in front of the selected lines.
Kevin
Duncan Murdoch [EMAIL PROTECTED] wrote:
On 24/09/2008 4:03 PM, Mark Na wrote:
Hello,
I know this has been discussed, but I haven't found an
I am calling auto.arima with a time series that is about 186 observations long
with a frequency of 52. With some time series I get:
1:last.nonzero: result would be too long a vector
Is there something that I can do to the data to avoid this error?
Thank you.
Kevin
I am trying to get package 'dse' and it seems to download OK:
Content type 'application/zip' length 1413606 bytes (1.3 Mb)
opened URL
downloaded 1.3 Mb
bundle 'dse' successfully unpacked and MD5 sums checked
The downloaded packages are in
. . . \downloaded_packages
updating HTML package
Sorry, this should have the rigth subject now.
[EMAIL PROTECTED] wrote:
I am trying to get package 'dse' and it seems to download OK:
Content type 'application/zip' length 1413606 bytes (1.3 Mb)
opened URL
downloaded 1.3 Mb
bundle 'dse' successfully unpacked and MD5 sums checked
Hello R users,
I am trying to get package 'dse' and it seems to download OK:
bundle 'dse' successfully unpacked and MD5 sums checked
But when I try to use it I get:
help(package=dse)
Error in .find.package(pkgName, lib.loc, verbose = verbose) :
there is no package called
I am sorry where is the download page or index?
Once I know that it is split out like this library(dse1) and library(dse2) work
just fine. My question now is how did you know this?
Thank you.
Kevin
Sarah Goslee [EMAIL PROTECTED] wrote:
If you look at the download page, or the index, or
I have search the archive and I could not find what I need so I will try to ask
the question here.
I read a table in (read.table)
a - read.table(.)
The table has column names like DayOfYear, Quantity, and Category.
The values in the row for Category are strings (characters).
I want to
I am using a simple R statement to read in the file:
a - read.csv(Sample.dat, header=TRUE)
There is alot of data but the first few lines look like:
DayOfYear,Quantity,Fraction,Category,SubCategory
1,82,0.390392720794458,(Unknown),(Unknown)
2,78,0.371349173438631,(Unknown),(Unknown)
. .
From the R console I invoke:
install.packages(RWinEdt)
and get:
Warning in install.packages(RWinEdt) :
argument 'lib' is missing: using 'F:\Users\Kevin\Documents/R/win-library/2.7'
--- Please select a CRAN mirror for use in this session ---
trying URL
I am sorry but if read.csv returns a dataframe and a dataframe is like a matrix
and I have a set of input like below and a[1,] gives me the first row, what is
the second index? From what I read and your input I am guessing that it is the
column number. So a[1,1] would return the DayOfYear
I think there is a problem with my file or with 'read.csv'.
As you said, a[1,] returns the first row
a[1,]
DayOfYear Quantity Fraction Category SubCategory
1 1 82 0.390392720794458 (Unknown) (Unknown)
a[2,] returns the second row
a[2,]
DayOfYear Quantity
OK. Now I know that I am dealing with a data frame. One last question on this
topic. a - read.csv() gives me a dataframe. If I have 'c - split(x,
x$Category), then what is returned by split in this case? c[1] seems to be OK
but c[2] is not right in my mind. If I run ci - split(nrow(a),
This is almost it. Maybe it is as good as can be expected. The only problem
that I see is that this seems to form a Category/SubCategory pair where none
existed in the original data. For example, A might have two sub-categories a
and b, and B might have two categories c and d. As far as I can
1 - 100 of 214 matches
Mail list logo