Displaying 20 results from an estimated 30000 matches similar to: "Importing CSV File"
2006 Oct 23
2
character manipulation
Dear R'helpers,
I am reading lines in a .txt file
Each line is stocked into a n elements object, as this:
[958] " 422 287 339 31 203 602 547 1026 500 366 346 227"
[959] " 410 67 11 220 110 451 562 598 732 163 163 220"
[960] " 179 513 95 186 102 595 333 1289 804 210 294 459"
[961] " 276 153 307 138 126 233 623 739 521 421 209 75"
[962] " 64
2008 Aug 08
1
write.csv writing the "index"
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 that the index is getting written out to the file. The first few lines look like:
2010 Oct 28
4
Returning highs and lows in R
I'm having trouble returning a rolling n period highest value for a data
set. For each day I want to calculate the highest value over the last 3
days. I am using the following packages: zoo, xts, quantmod and TTR.
Thanks, Jason
GLD.Close
2010-10-01 128.91
2010-10-04 128.46
2010-10-05 130.99
2010-10-06 131.81
2010-10-07 130.37
2010-10-08 131.66
2010-10-11
2011 Dec 27
1
differences between 1.7 and 1.7.1 glmnet versions
Dear All,
?
I have found differences between glmnet versions 1.7 and 1.7.1 which, in
my opinion, are not cosmetic and do not appear in the ChangeLog. If I am
not mistaken, glmnet appears to return different number of selected
input variables, i.e. nonzeroCoef(fit$beta[[1]]) differes between
versions. The code below is the same for 1.7.1 and 1.7, but you can see
that outputs differ. I would
2004 Jan 24
3
Grandstream 100 sidetone
For people who are using GS 101, what do you think the sidetone
generated by the phone.
I find mind a bit annoying. It has a delay and you notice it as an echo.
The volume of the sidetone is also quite hight. I am distracted when
both caller and called party talking over each other occasssionally.
The volume of the sidetone can be turned down using the volume button
but it also control the
2010 Oct 24
2
If Statement Help
Price
2010-10-11 99
2010-10-12 101
2010-10-13 102
2010-10-14 103
2010-10-15 99
2010-10-18 98
2010-10-19 97
2010-10-20 101
2010-10-21 101
2010-10-22 101
I have this dataset and I only want to return instances when the Price is >
100.
If I use the code: Price > 100 then it will evaluate each entry as "TRUE" or
"FALSE". What is the code
2013 Feb 27
2
matrix multiplication
Hi,
Try this:
#mat1 is the data
res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2012 Dec 04
1
Periodicity of Weekly Zoo
Hi List,
I have weekly sales observations for several products drawn via ODBC.
Source data is available at
https://www.dropbox.com/s/78vxae5ic8tnutf/asr.csv.
This is retail sales data, so will contain seasonality and trend
information. I expect to see 52 or 53 observations per year, each
observation occuring on the same day of the week (Saturday). Ultimately
I'm looking to feed these series
2011 Nov 24
1
what is wrong with this dataset?
> d = data.frame(gender=rep(c('f','m'), 5), pos=rep(c('worker', 'manager',
'speaker', 'sales', 'investor'), 2), lot1=rnorm(10), lot2=rnorm(10))
> d
gender pos lot1 lot2
1 f worker 1.1035316 0.8710510
2 m manager -0.4824027 -0.2595865
3 f speaker 0.8933589 -0.5966119
4 m sales
2008 Jul 22
2
Help with rearranging data
In Excel, I have data that looks like this.
Month
Seg
Prod
Biller
Cycle
Sales
1/1/2008
A
Table
Phyllis
1
500
1/1/2008
A
Table
Phyllis
2
600
1/1/2008
A
Table
Phyllis
3
650
1/1/2008
A
Table
Doreen
1
345
1/1/2008
A
Table
Doreen
2
451
1/1/2008
A
Table
Doreen
6
550
1/1/2008
A
Table
Doreen
9
590
1/1/2008
A
Table
Doreen
11
860
1/1/2008
A
Chair
Phyllis
1
300
1/1/2008
A
Chair
Phyllis
2
350
2011 Sep 08
1
3D plot RGL
Hi, anyone has experience with 3D plot (ex: in package RGL) I have a
question, I draw a 3D plot of country, year and sales in z axis but when the
type is "h" then it's ok but when I want to link the points and type is 'l'
lines it's a mess Is there a way to link the points only in one direction?
For example a unique line from each country through each year?
The code
2024 Jun 28
2
write.csv problems
Hello, All:
I'm getting strange errors with write.csv with some objects of class
c('findFn', 'data.frame'). Consider the following:
df1 <- data.frame(x=1)
class(df1) <- c('findFn', 'data.frame')
write.csv(df1, 'df1.csv')
# Error in x$Package : $ operator is invalid for atomic vectors
df2 <- data.frame(a=letters[1:2],
2024 Jun 29
1
write.csv problems
?s 17:02 de 28/06/2024, Spencer Graves escreveu:
> Hello, All:
>
>
> ????? I'm getting strange errors with write.csv with some objects of
> class c('findFn', 'data.frame'). Consider the following:
>
>
> df1 <- data.frame(x=1)
> class(df1) <- c('findFn', 'data.frame')
> write.csv(df1, 'df1.csv')
> # Error in
2012 Mar 28
1
CI with confint
Hello all,
I'm trying to use confint from the MASS package to compute confidence
intervals for an nls object. When I plot the results, however, they don't
make sense - lines cross over the fitted model or just don't match the
data. Code is :
Thanks for help
dat<-data.frame(a,b)
with(dat, plot(a,b))
model<-(nls(b~(1/exp(a*x))*n, data=dat, start=list(x=.001,n=20),
2010 Oct 25
1
CRAN vs R-Forge
What's the difference between the packages you get from CRAN and R-Forge?
Are the packages you get from CRAN fully developed and R-Forge
work-in-progress?
Regards,
Jason
[[alternative HTML version deleted]]
2010 Oct 29
2
Plotting 2 Lines on the Same Chart
How do I plot two time series plots on the same chart?
Thanks,
Jason
[[alternative HTML version deleted]]
2012 Jul 19
3
Maintaining Column names while writing csv file.
Dear R helpers,
I have one trivial problem while writing an output file in csv format.
I have two dataframes say df1 and df2 which I am reading from two different csv files.
df1 has column names as date, r1, r2, r3 while the dataframe df2 has column names as date, 1w, 2w.
(the dates in both the date frames are identical also no of elements in each column are equal say = 10).
I merge these
2012 Sep 19
2
Importing a CSV file
Hi,
I am trying to import csv file in R console
I have saved my data in a file on the desktop named R and here is my
problematic script
> load("C:\\Users\\Anthi\\Desktop\\R\\A.csv")
Error: bad restore file magic number (file may be corrupted) -- no data
loaded
In addition: Warning message:
file ‘A.csv’ has magic number ';Abra'
Use of save versions prior to 2 is deprecated
2005 Dec 07
4
Importing data for excel file or csv file
hey,
i have this website (with ajax also) with lot of records of employee, and as an
extra feature i want that the customer can import his employeelist (perhaps 100+
records), lot of work to do this manually.
i would create a template like this
Firstname Lastname Phone
xxxx xxxxx xxxxx
yyyy yyyyy yyyyy
then they upload the excel file or save it as csv file
2004 Dec 23
2
Importing csv files
There is a recurring need for importing large csv files quickly. David
Baird's dataload is a standalone program that will directly create .rda
files from .csv (it also handles many other conversions). Unfortunately
dataload is no longer publicly available because of some kind of
relationship with Stat/Transfer. The idea is a good one, though. I
wonder if anyone would volunteer to