Displaying 20 results from an estimated 40000 matches similar to: "Read from a website"
2010 Oct 11
3
Dataset Transformation
I need to transpose the following input dataset into an output dataset like
below
Input
Date
TICKER
Price
11/10/2010
A
0.991642
11/10/2010
B
0.475023
11/10/2010
C
0.218642
11/10/2010
D
0.365135
12/10/2010
A
0.687873
12/10/2010
B
0.47006
12/10/2010
C
0.533542
12/10/2010
D
0.812439
13/10/2010
A
0.210848
13/10/2010
B
0.699799
13/10/2010
C
2010 Oct 14
5
Replacing N.A values in a data frame
Hello, I have a data frame as below ... in cases where I have N.A. I want
to use an average of the past date and next date .. any help?
13/10/2010 A 23
13/10/2010 B 12
13/10/2010 C 124
14/10/2010 A 43
14/10/2010 B 54
14/10/2010 C 65
15/10/2010 A 43
15/10/2010 B N.A.
15/10/2010 C 65
----------------------------------------------------------------------------
--------------------------
Thanks
2010 Oct 14
1
Basic data question
I have a question about the output given below after running few lines of
code. Surely a 101 query!
MF_Data <- read.csv("MF_Data_F.txt", header = F, sep="|")
temp <- head(MF_Data) #Get the sample Data
temp1 <- subset(temp, select= c(V1,V4,V6)) #where V1, V4, V6 are the col
names .. to Get the relevant data
names(temp1) <- c('Ticker',
2010 Aug 04
2
Finding the right url for RCurl
Hi all,
I am using RCurl to try and download data from a website, but I'm having
trouble finding out what URL to use. Here is the site:
http://www.invescopowershares.com/products/holdings.aspx?ticker=PGX
See how in the upper right, above the displayed sheet, there's a link to
download the data as a .csv file? When I hit "copy url" and paste into
getURL in R, it doesn't
2010 Nov 04
3
postForm() in RCurl and library RHTMLForms
Hi RUsers,
Suppose I want to see the data on the website
url <- "http://www.nseindia.com/content/indices/ind_histvalues.htm"
for the index "S&P CNX NIFTY" for
dates "FromDate"="01-11-2010","ToDate"="02-11-2010"
then read the html table from the page using readHTMLtable()
I am using this code
webpage <-
2011 Feb 22
2
read.table
Hi Group,
I am having a strange problem for this simple task.
I am using read.table to read a plan 3 column CSV file . the file is getting
read .
But the first column has datetime in the csv file in the following format:
20110221.114041
But this is being read as 20110221 only . the time portion (decimal is
missing) in the data frame
Any idea why?
Thanks,
Santosh
2010 Sep 17
7
removing specific rows from array
I'm attempting to create an array of treatment comparisons for modelling data generation. This involves comparison of one treatment (c2) with another (c3), relative to a common comparator (c1).
Attached code gives me the correct array but need to remove duplicates. Duplicates relate only to c2 and c3
such that I need to remove
r3 because c2 and c3 are same as r1 with c2 and c3 swapped
r5
2011 Mar 17
3
Flexible rbind
Dear All,
I am trying to create a empty structure that I want to fill gradually
through the code.
I want to use something like rbind to create the basic structure first.
I am looking for a possibility to do an rbind where the columns names
dont match fully (but the missing columns can be defaulted to either
zero or n/a) (my actual data has a lot of columns).
Please see the data frames below
I
2010 Nov 03
4
Drawing circles on a chart
Dear Group,
I have the following data matrix which is a timeseries.
> dput(tData)
structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09,
0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01,
0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06,
-0.08, -0.07), D = c(-0.15, -0.05, -0.1, -0.03, -0.13, -0.04,
-0.1, -0.04, -0.15), E = c(-0.17, -0.16, -0.08, -0.07, -0.09,
2010 Nov 09
3
Row-wise recurive function call
Dear Group,
I have a following dataset:
> a
A B C D
1 22 3 31 40
2 26 31 36 32
3 3 7 49 16
4 24 40 27 26
5 20 45 47 0
6 34 43 11 18
7 48 48 24 2
8 3 16 39 48
9 20 49 7 21
10 17 36 47 10
> dput(a)
structure(list(A = c(22L, 26L, 3L, 24L, 20L, 34L, 48L, 3L, 20L,
17L), B = c(3L, 31L, 7L, 40L, 45L, 43L, 48L, 16L, 49L, 36L),
C = c(31L, 36L, 49L, 27L, 47L, 11L, 24L,
2010 Oct 22
2
If Statement with more than one condition
I'm unable to find the OR operator like other language .. any suggestions?
I want to do If (condition1 OR condition 2){ do something }
Thanks for answering this elementary question.
[[alternative HTML version deleted]]
2010 Nov 01
2
write.csv changes the format of the date
Dear Group,
Why does write.csv modify the date format when it write to a file.
I have the following variable Param_Dat:
dput(Param_Dat)
structure(list(Last_Successful_Run = structure(1L, .Label = "30/10/2010",
class = "factor")), .Names = "Last_Successful_Run", class = "data.frame",
row.names = c(NA,
-1L))
When I do:
2011 Apr 18
1
Print out data frames into neat images
Hi Group,
I often need to print out data frames with results of analysis into a
neat little image to copy and paste into documents. I need apply
formatting like bold, currency signs, number formats, header shading
etc.
I currently output the data into csv and format using good old excel.
Any suggestions if there are packages to help with such activities (to
some level of basic functionality).
I
2010 Oct 27
5
Best IDE for R
Dear R-Group,
I am looking for suggestions for the "best" IDE for R. Best is obviously
subjective but I need just the basic features that should function well (and
I looked through the threads already).
- Proper integration with R 2.11.1
- Good key shortcuts ... similar to the R Gui
- Manageability of Projects, etc.
- Neat formatting features
I tried Revolution R but it seems huge in
2010 Dec 03
2
data.table query
Hello Group,
I need a modification in the data.table example to get my intended
result shown below ... is there a more simple way!
dt <- data.table(A = rep(1:3, each=4), B = rep(1:4, each=3), C = rep(1:2, 6))
dt[, transform(.SD,D=mean(A)), by="B"]
The result I want is below ... which is probably long winded!
data.table(unique(as.data.frame(dt[, transform(.SD,D=mean(A)),
2010 Dec 03
3
colname refered by a variable
Hello,
I tried to use a variable to refer colname, but I got error, could anyone give me advice?
>df=data.frame(cbind(AB=1:3,AC=3:5))
> df$AC
[1] 3 4 5
> df$paste("A","C",sep="")
Error: attempt to apply non-function
thanks
Jian
[[alternative HTML version deleted]]
2010 Dec 05
3
grep for strings
I am trying to find the function where I can search for a pattern in a
text string (I thought I could use grep for this but no :().
> x
[1] "abcdefghijkl"
I want to find the positions (i.e. equivalent of nchar) for "cd" and
in case there are multiple hits .. then the results as a array
Thank you.
2007 Mar 07
1
Read data with different column lengths
Dear r-help users,
I have the following simple problem: Reading data from a file. The
file is a .txt file exported ("save as...") from Excel (see below for
an example). The Excel file consists of two header rows (first row
consists of ticker symbols of stocks, the second row consists of
column explanations ("Date","Px Last"), followed by several rows of
2010 Nov 12
2
Time Delay / Wait
Hi Group,
Is there something like a delay function based on System time or equivalent?
I basically am generating a few graphs and I would like to see each graph
for say 2mins before moving on to the next one?
I can always have an empty for-loop I guess but is there a better way?
Thanks,
S
2010 Dec 07
2
Time out for a R Function
Hello Group,
I have an R-function that works fine for most part but sometime runs into a
long loop! (I'm lazy and short on time to debug right now so want to do
something easy)
For my purpose, it is ok to make few errors .... is there a way I can put a
timeout on a function and the r-process needes to move on to the next step?
Thank you.
S