Displaying 12 results from an estimated 12 matches similar to: "Stuck ...can't get sapply and xmlTreeParse working"
2011 Jul 10
1
Help with tryCatch
Having a hard time understanding the help files for tryCatch. Looking for a
little help with the following statement which sits inside a for loop
zest[i] <- tryCatch(sapply(getNodeSet(zdoc, "//zestimate/amount"),
xmlValue), error=function() zest[i] <-"NA")
zest is a numeric vector
If the sapply statement evaluates to an error, I'd like to set the value of
zest[i]
2011 May 28
1
newbie xml parsing question
I am trying to read some data off the zillow site. Newbie to xml, html,
parsing and the xml package. I've been able to load the web page I'm
interested with the following code but I'm not sure of the next step to get
the information I'm interested in into R :
library(XML)
url <- "http://www.zillow.com/homes/511 W Lafayette St, Norristown, PA_rb"
doc <-doc <-
2011 May 26
2
What am I doing wrong with sapply ?
Statement 9 using sapply does not seem to give the correct answer (or at
least to me). Yet I do what I think is the same thing with statement 11 and
I get the answer I'm looking for.
9 : s <-sapply(unlist(v[c(1:length(v))]), max)
11: for(i in 1 :length(v)) v1[i] <- max(unlist(v[i]))
Shouldn't I get the same answer ?
library(XML)
rm(list=ls())
url <-
2009 Mar 04
10
total per user
so I am trying to sum month over month the amount that a user has
posted. So for example:
User 1: Jan $3000 Feb $4000 March $1500, etc. I can get this to work
if I sum totals (aggregate of all users) but just not by user.
Here is my code in the controller:
def index
@users = User.find :all, :order => ''name ASC''
@deal_groups = Deal.find(:all).group_by {|t|
2011 May 15
1
Need help with text processing / string split
I used screen scraping to extract some information and put it into a table
called tbl. Now I want to modify the table a bit so the data can be more
useful. Here's the code I used:
library(XML)
rm(list=ls())
url <-
"http://webapp.montcopa.org/sherreal/salelist.asp?saledate=05/25/2011"
tbl <-data.frame(readHTMLTable(url))[2:405, c(3,5,6,8,9)]
names(tbl) <-
2010 Mar 10
1
Joining elements of an array into a single element
Dear forum:
I've been trying like for hours but I cannot solve this. I wonder if you could give me a hand.
I would like to combine the following elements of an array which I must generate in order to get the syntax I need for another software, lets say:
c<-c(1:7)
zest<-c(12,34,45,132,56,23,6)
p<-"[foresnat2]"
for(i in 1:7){tre[i]<-paste("con(",p," ==
2011 Feb 09
4
Modules being shared and model data
Have in a module in ./lib:
module Pricing
def sell_price
(cost.to_f)/((100-(margn.to_f))/100)
end
def sell_price_inc
((product.cost.to_f)/((100-(product.margn.to_f))/100)*1.14)
end
def charge_excl
(sell_price).to_f * quantity
end
end
A model product:
class Product < ActiveRecord::Base
include Pricing
attr_accessible :name, :code, :cost, :company_id, :margn
2006 Apr 18
12
Formatting data drawn from a DB
Question for all:
Right now i have a Table in a mySQL DB that has a row called
Ingredients. When the data is entered into the DB its enter like so
from a text area:
1 1/2 lbs. beef top sirloin, thinly sliced
1/3 cup white sugar
1/3 cup rice wine vinegar
2 tablespoons frozen OJ concentrate
1 teaspoon salt
1 tablespoon soy sauce
1 cup long grain rice
2 cups water
1/4 cup cornstarch
2 teaspoons
2011 Apr 06
0
Curious treatment of entities in xmlTreeParse
Hello!
I am not experienced enough to know whether I have found a bug or
whether I am just ignorant.
I have been trying to use the tm package to read in material from RSS
2.0 feeds, which has required grappling with writing a reader for that
flavour of XML. I get an error - "Error : 1: EntityRef: expecting ';' -
which I think I've tracked down.
The feed being processed is from
2010 Jan 20
1
possible bug
Hello,
don't know if this behavior is a bug, but I want to share this
information.
samba server version 3.4.3 is installed on solaris10 x86
compiled with gcc
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure
--prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as
--with-ld=/usr/ccs/bin/ld
2008 Sep 06
0
Tab control using FXRuby
In the sample program below I have a form of 6 text fields, in a scrolling
window, followed by a row of function buttons.
Problems:
1) For data entry purposes I''d like the function buttons NOT to be entered
by pressing Tab keys, and retain their ''clickability'', but when the user
Tab''s out of the last scrolling field (postcode) to have the form scroll to
the
2017 Jul 07
1
Gluster 3.11 on ubuntu 16.04 not working
Hi There,
we have a problem with a fresh installation of gluster 3.11 on a ubuntu
16.04 server.
we have made the installaton straight forward like it ist described on
the gluster.org website.
<http://gluster.readthedocs.io/en/latest/Install-Guide/Configure/>
in fstab is:
/dev/sdb1 /gluster xfs defaults 0 0
knoten5:/gv0 /glusterfs glusterfs defaults,_netdev,acl,selinux 0 0
after