Definitely doable and you are on the right path and maybe even close.
The error message you got showed your query as having the wrong info after
the 'FROM'
keyword
' SELECT * FROM c("BIODBX.MECCUNIQUE2", "BIODBX.QDATA_HTML_DUMMY",
"BIODBX.SET_ITEMS", "BIODBX.SET_NAMES", "dbo.sysdiagrams",
"GEMD.A
Hi Eric,
Thank you spent time to help me for this.
Here is the thing: I was requested to manage a sql server for my group. the
server has many schemas and the tables (>200). I use ODBC to connect the server
and get the schema name + table name into a data frame.
For each of schema + table on s
Not all advice received on the Internet is safe.
https://xkcd.com/327
https://db.rstudio.com/best-practices/run-queries-safely
It is not that much more difficult to do it right.
On July 2, 2021 12:05:43 PM PDT, Eric Berger wrote:
>Modify the summ() function to start like this
>
>summ <- functi
Hard for me to tell without more details but it looks like the following
has several bugs
for (i in dbtable$Tot_table)
{
Tabname <- as.character(sqldf(sprintf("SELECT Tot_table FROM dbtable",
i)))
summ(Tabname)
}
Your sprintf() statement seems to use 'i' but actually does not.
You probably wa
Hello Eric,
Following your suggestion, I modified the code as:
summ <- function(Tabname){
query <- sprintf(" SELECT * FROM %s",Tabname)
res <- dbGetQuery(con, query)
view(dfSummary(res), file =
"W:/project/_Joe.B/MSSQL/try/summarytools.Tabname.html")
rm(res)
}
for (i in dbtable$Tot_table
Modify the summ() function to start like this
summ <- function(Tabname){
query <- sprintf(" SELECT * FROM %s",Tabname)
res <- dbGetQuery(con, query)
etc
HTH,
Eric
On Fri, Jul 2, 2021 at 9:39 PM Kai Yang via R-help
wrote:
> Hello List,
>
> The previous post look massy. I repost my questio
Hello List,
The previous post look massy. I repost my question. Sorry,
I need to generate summary report for many tables (>200 tables). For each
table, I can use the script to generate report:
res <- dbGetQuery(con, "SELECT * FROM BIODBX.MECCUNIQUE2")
view(dfSummary(res), file =
"W:/project/_J
Hello List,I need to generate summary report for many tables (>200 tables). For
each table, I can use the script to generate repost:
res <- dbGetQuery(con, "SELECT * FROM BIODBX.MECCUNIQUE2")view(dfSummary(res),
file =
"W:/project/_Joe.B/MSSQL/try/summarytools.BIODBX.MECCUNIQUE2.html")rm(res)
BI
Try this:
foo <- function(expr, x){
eval(substitute(expr))
}
foo(x^2, 4)
foo(x^3-10, 2)
On Fri, Sep 25, 2009 at 6:16 PM, njhuang86 wrote:
>
> Hi. I was wondering how I can write a function that generates the outcome
> values for a user specified equation. For example, function(x^2, 4) w
Hi. I was wondering how I can write a function that generates the outcome
values for a user specified equation. For example, function(x^2, 4) will
return back 16 and function(x^3 - 10, 2) will give back -2...
I've been playing around with various lines of code but somehow, I just
cannot get R to
ge-
> From: Wacek Kusnierczyk [mailto:waclaw.marcin.kusnierc...@idi.ntnu.no]
> Sent: Thursday, March 19, 2009 1:03 PM
> To: Bert Gunter
> Cc: Edna Bell; R help
> Subject: Re: [R] function question
>
> Bert Gunter wrote:
>
>> Edna:
>>
>> Please make at le
Not surprising at all -- expected!
is.function(vector) ##TRUE
-- Bert
-Original Message-
From: Wacek Kusnierczyk [mailto:waclaw.marcin.kusnierc...@idi.ntnu.no]
Sent: Thursday, March 19, 2009 1:03 PM
To: Bert Gunter
Cc: Edna Bell; R help
Subject: Re: [R] function question
Bert Gunter
Bert Gunter wrote:
> Edna:
>
> Please make at least a minimal effort to answer such questions before
> posting.
>
> is.vector(function(x)x) ## FALSE
> as.vector(function(x)x) ## try it
>
> or even
>
> is.vector(plot)
>
>
... or even the surprizing
is.vector(vector)
vQ
___
Patrick Burns wrote:
Duncan Murdoch wrote:
On 3/19/2009 12:49 PM, Edna Bell wrote:
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
Your question is a little ambiguous (you probably did read that, and
probably someone does consider them to be vect
In mathematics that is the case.
That is vector v = (v_1, v_2, ..., v_n) can be considered to be the
function which maps k to v_k but there is no real relation to this
in terms of R classes and objects.
On Thu, Mar 19, 2009 at 12:49 PM, Edna Bell wrote:
> Dear R Gurus:
>
> I read somewhere that
Duncan Murdoch wrote:
On 3/19/2009 12:49 PM, Edna Bell wrote:
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
Your question is a little ambiguous (you probably did read that, and
probably someone does consider them to be vectors), but I think the
-project.org] On
Behalf Of Edna Bell
Sent: Thursday, March 19, 2009 9:50 AM
To: r-h...@stat.math.ethz.ch
Subject: [R] function question
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
thanks
Edna Bell
__
R
On 3/19/2009 12:49 PM, Edna Bell wrote:
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
Your question is a little ambiguous (you probably did read that, and
probably someone does consider them to be vectors), but I think the
right answer is no: w
Dear R Gurus:
I read somewhere that functions are considered vectors.
Is this true, please?
thanks
Edna Bell
__
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/po
Is this what you want:
> x
FL number
1 34 4
2 35 3
3 36 7
> cbind(rep(x$FL, x$number), 1)
[,1] [,2]
[1,] 341
[2,] 341
[3,] 341
[4,] 341
[5,] 351
[6,] 351
[7,] 351
[8,] 361
[9,] 361
[10,] 361
[11,] 361
Hi everyone:
I did this before with R and I can't remember how.
I got some fish forklength values
FL number
344
353
367
I need to breakdown the FL by the number of fish with the same length
like this:
34 1
34 1
34 1
34 1
35 1
35 1
35 1
36 1
36 1
36 1
36 1
36 1
36 1
36 1
try uniroot(), e.g.,
f <- function (x) x^2
uniroot(function(x, a) f(x) - a, c(0, 10), a = 4)
I hope it helps.
Best,
Dimitris
dennis11 wrote:
Hi,
Let's say very simply there is a function:
f <- function (x) x^2
which is evaluated with :
f(2)
Now, I want to do the reverse so I want to no
Hi,
Let's say very simply there is a function:
f <- function (x) x^2
which is evaluated with :
f(2)
Now, I want to do the reverse so I want to now x for f(x) = 4
So, is there a way in R to solve x for some function f(x)=a?
I hope I explained it clear.
cheers,
Dennis
--
View this message
23 matches
Mail list logo